public static Expression <Func <Lot, bool> > FilterByProductKey(ILotUnitOfWork lotUnitOfWork, IKey <Product> productKey) { var productPredicate = productKey.FindByPredicate; var product = LotProjectors.SelectProduct(lotUnitOfWork); return(l => productPredicate.Invoke(product.Invoke(l))); }
internal static Expression <Func <Lot, bool> > FilterByProductType(ILotUnitOfWork lotUnitOfWork, ProductTypeEnum productType) { if (lotUnitOfWork == null) { throw new ArgumentNullException("lotUnitOfWork"); } var product = LotProjectors.SelectProduct(lotUnitOfWork); return(l => product.Invoke(l).ProductType == productType); }