예제 #1
0
        public async Task <InvoicesDto> GetInvoicebyId(Guid id)
        {
            await Task.Delay(200);

            var invoice     = Invoice.Invoices.FirstOrDefault(x => x.InvoiceId == id);
            var invoicesDto = new InvoicesDto(invoice);

            return(invoicesDto);
        }
예제 #2
0
        public async Task <IEnumerable <InvoicesDto> > Get()
        {
            //return Invoice.Invoices.OrderByDescending(x => x.Price);
            try
            {
                await Task.Delay(500);

                var listInvoicesDto = new List <InvoicesDto>();
                foreach (var item in Invoice.Invoices)
                {
                    var invoicesDto = new InvoicesDto(item);
                    listInvoicesDto.Add(invoicesDto);
                }
                return(listInvoicesDto.OrderByDescending(e => e.InvoiceId));
            }
            catch (Exception)
            {
                return(null);
            }
        }