/// <summary> /// Update dish data and save changes. /// </summary> /// <param name="dish">Dish entity</param> public void Update(Dish dish) { _ctx.Entry(dish).State = EntityState.Modified; _ctx.SaveChanges(); }
/// <summary> /// Add dish to db. /// </summary> /// <param name="dish">Dish entity</param> public void Add(Dish dish) { _ctx.Dishes.Add(dish); _ctx.SaveChanges(); }