public IEnumerable <PizzaStore.Library.User> GetUserLastName(string search = null) { if (search == null) { return(PizzaStoreMapper.Map(_db.Users.Include(o => o.Orders).AsNoTracking())); } else { return(PizzaStoreMapper.Map(_db.Users.Include(o => o.Orders) .AsNoTracking().Where(z => z.LastName.Contains(search)))); } }
public IEnumerable <PizzaStore.Library.User> GetUserPhoneNumber(string search = null) { if (search == null) { return(PizzaStoreMapper.Map(_db.Users.Include(o => o.Orders).AsNoTracking())); } else { return(PizzaStoreMapper.Map(_db.Users.Include(o => o.Orders) .AsNoTracking().Where(p => p.PhoneNumber.Contains(search)))); } }
public void AddUsertoDB(User user) { _db.Add(PizzaStoreMapper.Map(user)); }
public void AddUserPhoneNumber(User phone_Number) { _db.Add(PizzaStoreMapper.Map(phone_Number)); }
public void AddUserLastName(User last_Name) { _db.Add(PizzaStoreMapper.Map(last_Name)); }
public void AddUserFirstName(User first_Name) { _db.Add(PizzaStoreMapper.Map(first_Name)); }
public User GetUsersByID(int id) { return(PizzaStoreMapper.Map(_db.Users.Include(o => o.Orders) .AsNoTracking().First(y => y.UserIds == id))); }
public void AddPizzas(Pizza p) { _db.Add(PizzaStoreMapper.Map(p)); }
public void AddOrder(Order order) { _db.Add(PizzaStoreMapper.Map(order)); }
public PizzaStore.Library.Order GetOrdersById(int id) { return(PizzaStoreMapper.Map(_db.Orders.Include(o => o.OrderId) .AsNoTracking().First(x => x.UserIds == id))); }
public void AddLocation(PizzaStore.Library.Location location) { _db.Add(PizzaStoreMapper.Map(location)); }
public IEnumerable <PizzaStore.Library.Location> GetLocations(string search = null) { return(PizzaStoreMapper.Map(_db.Locations)); }