Пример #1
0
        public List <domain.OrderModel> ReadUser(domain.UserModel user)
        {
            var UserHistory = _db?.Users
                              .Include(t => t.UserOrders)
                              .ThenInclude(t => t.Pizzas)
                              .ThenInclude(t => t.Toppings)
                              .FirstOrDefault(u => u.Name == user.Name);

            if (UserHistory == null)
            {
                return(new List <domain.OrderModel>());
            }
            else
            {
                return(UserHistory.UserOrders);
            }
        }
Пример #2
0
 public void CreateUser(domain.UserModel userModel)
 {
     _db.Users.Add(userModel);
     _db.SaveChanges();
 }