I have an IQueryable of Gizmo.
I want to write LINQ statement that will filter all Gizmos whose color is in the parameter (string[]) that I pass.
For example:
public class Gizmo
{
public string Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Color> Colors { get; set; } = new List<Color>();
}
public class Color
{
public string Id { get; set; }
public string Value { get; set; }
}
I will be supplied a parameter like:
var filterColors = new[] { "red", "silver" };
I want to write something similar to:
gizmos = gizmos.Where(x => x.ColorTags.Contains(filterColors));