示例#1
0
        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)));
        }
示例#2
0
        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);
        }