Exemplo n.º 1
0
        public IQueryable <ManualStockOperation> Apply(IQueryable <ManualStockOperation> q)
        {
            q = q.ApplySort(SortBy);

            if (StockItemId.Any())
            {
                var stockItemIds = StockItemId;
                q = q.Where(stockOp => stockItemIds.Contains(stockOp.StockItemId));
            }

            if (ByUserId is Guid userId)
            {
                q = q.Where(stockOp => stockOp.CreatedByUserId == userId);
            }

            return(q);
        }
        public IQueryable <SaleBasedStockOperation> Apply(IQueryable <SaleBasedStockOperation> q)
        {
            q = q.ApplySort(SortBy);

            if (StockItemId.Any())
            {
                var stockItemIds = StockItemId;
                q = q.Where(stockOp => stockItemIds.Contains(stockOp.StockItemId));
            }

            if (SaleId is Guid saleId)
            {
                q = q.Where(stockOp => stockOp.SaleId == saleId);
            }

            return(q);
        }