Use LinqSpecs to match a collection against a collection of ids like so:
public static Specification<Foo> IdCriteria(IList<Guid> Ids)
{
var fooSpec = new AdHocSpecification<Foo>(f => Ids.Contains(f.Id));
return fooSpec;
}
Call the method like so:
specBuilder.AddAnd(GetSpecs.IdCriteria((Array.ConvertAll(myListOfIdsAsStrings, e => new Guid(e)))));
No comments:
Post a Comment