コード例 #1
0
        public async Task <bool> ExistAsync(Guid id)
        {
            var request = await _context
                          .FindAsync <ClientRequest>(id);

            return(request != null);
        }
コード例 #2
0
        public async Task <ActionResult <Order> > GetOrder(int orderID)
        {
            var order = await _context.FindAsync <Order>(orderID);

            if (order == null)
            {
                return(NotFound());
            }

            // Get Order.OrderItems
            await _context.Entry(order).Collection(o => o.OrderItems).LoadAsync();

            return(order);
        }
コード例 #3
0
 public async Task <Order> GetByAsync(Guid id)
 {
     return(await _context.FindAsync <Order>(id));
 }