コード例 #1
0
        public IEnumerable <InvoiceServiceResponse> GetInvoices(InvoiceCollectionServiceRequest request)
        {
            request.UpperTotal = request.UpperTotal == 0 ? decimal.MaxValue : request.UpperTotal;

            var entities = _context.Invoices
                           .Where(i => request.CompanyId == Guid.Empty || i.CompanyId == request.CompanyId)
                           .Where(i => request.InvoiceType == InvoiceType.None || i.InvoiceType == (i.InvoiceType & request.InvoiceType))
                           .Where(i => i.TotalValue >= request.LowerTotal && i.TotalValue <= request.UpperTotal)
                           .Where(i => i.TotalValue >= request.LowerTotal && i.TotalValue <= request.UpperTotal);

            return(AutoMapperConfig.Map <IEnumerable <Invoice>, IEnumerable <InvoiceServiceResponse> >(entities));
        }
コード例 #2
0
 public ActionResult <InvoiceServiceResponse> GetInvoices([FromHeader] InvoiceCollectionServiceRequest request)
 => Ok(_invoiceManager.GetInvoices(request));