public void UpdateUser(User user) { using (Entities.AppContext appContext = new Entities.AppContext()) { appContext.Entry <User>(user).State = EntityState.Modified; appContext.SaveChanges(); } }
public void UpdateShop(Shop shop) { using (Entities.AppContext appContext = new Entities.AppContext()) { appContext.Entry <Shop>(shop).State = EntityState.Modified; appContext.SaveChanges(); } }
public void UpdateTypeOfShop(TypeOfShop typeOfShop) { using (Entities.AppContext appContext = new Entities.AppContext()) { appContext.Entry <TypeOfShop>(typeOfShop).State = EntityState.Modified; appContext.SaveChanges(); } }
public void UpdateAddress(Address address) { using (Entities.AppContext appContext = new Entities.AppContext()) { appContext.Entry <Address>(address).State = EntityState.Modified; appContext.SaveChanges(); } }
public void SetRate(Rating rating, User user, Shop shop, int rate) { using (Entities.AppContext appContext = new Entities.AppContext()) { rating.User = user; rating.Shop = shop; rating.IdUser = user.IdUser; rating.IdShop = shop.IdShop; rating.Rate = rate; appContext.Entry <Rating>(rating).State = EntityState.Modified; appContext.SaveChanges(); } }
public Repas Enregistrer(Repas repas) { using (Entities.AppContext context = new Entities.AppContext()) { if (repas.Id > 0) { context.Repas.Attach(repas); context.Entry(repas).State = System.Data.Entity.EntityState.Modified; } else { context.Repas.Add(repas); } context.SaveChanges(); } return(repas); }
public Client Enregistrer(Client cli) { using (Entities.AppContext context = new Entities.AppContext()) { if (cli.IdentifiantCli > 0) { context.Clients.Attach(cli); context.Entry(cli).State = System.Data.Entity.EntityState.Modified; } else { context.Clients.Add(cli); } context.SaveChanges(); } return(cli); }