示例#1
0
        public async Task <IEnumerable <Resturant> > GetResturantsByLocation(string location)
        {
            if (!String.IsNullOrEmpty(location))
            {
                var resturantSearchResult = await _userDbOpService.GetDbContext().Resturants.Where(m => m.Location == location).ToListAsync();

                return(resturantSearchResult);
            }

            return(null);
        }
 public async Task AddToCart(Cart cartItem)
 {
     _context.GetDbContext().Carts.Add(cartItem);
     await _context.GetDbContext().SaveChangesAsync();
 }
示例#3
0
 public async Task <IEnumerable <DeliveryStatus> > GetUserDeliveryStatus(string userName)
 {
     return(await _db.GetDbContext().DeliveryStatuses.Where(m => m.UserName == userName).ToListAsync());
 }
 public async Task <Food> GetOneFood(int id)
 {
     return(await _context.GetDbContext().Foods.Include(m => m.Resturant).FirstOrDefaultAsync(m => m.ID == id));
 }