public void EditPizza(Pizzas Pizza) { // would add it if it didn't exist _db.Update(Pizza); // sometimes we need to do it a different way //var trackedMovie = _db.Movie.Find(movie.Id); //_db.Entry(trackedMovie).CurrentValues.SetValues(movie); }
public void AddPizzas(string size, decimal price, string name, int crust) { // LINQ: First fails by throwing exception, // FirstOrDefault fails to just null var Pizza = new Pizzas { Name = name, Price = price, Size = size, Crust = crust }; _db.Add(Pizza); }