コード例 #1
0
        public void Update(Dishes dish)
        {
            Dishes dishToUpdate = context.Dishes.FirstOrDefault(d => d.Id == dish.Id);

            dishToUpdate.Name        = dish.Name;
            dishToUpdate.Description = dish.Description;
            dishToUpdate.Price       = dish.Price;

            context.Update(dishToUpdate);
            context.SaveChanges();
        }