public async Task <List <OrderDetail> > GetOrderDetails(int orderId)
        {
            logger.LogInformation($"{nameof(GetOrderDetails)}. {nameof(orderId)}:{orderId}");
            var result = await context.DoWithResult <DbOrderDetail, List <DbOrderDetail> >(x => x.Where(c => c.OrderId == orderId).ToListAsync());

            return(result.Select(x => x.To <OrderDetail>()).ToList());
        }
Ejemplo n.º 2
0
        public async Task <List <Order> > GetOrders()
        {
            logger.LogInformation($"{nameof(GetOrders)}.");
            var result = await context.DoWithResult <DbOrder, List <DbOrder> >(x => x.ToListAsync());

            return(result.Select(x => x.To <Order>()).ToList());
        }
        public async Task <List <Order> > Get(Int32?orderId, DateTime?start, DateTime?end)
        {
            var result = await context.DoWithResult <DbOrder, List <DbOrder> >(os =>
                                                                               os.AsQueryable().ApplyOrderFilter(orderId, start, end).ToListAsync());

            return(result.Select(x => x.DbOrderToOrder()).ToList());
        }