public Models.Beer AddBeer(Models.Beer beer) { BeerDbContext context = new BeerDbContext(); context.Beers.Add(beer); context.SaveChanges(); return(beer); }
public JsonResult Edit(BeerAppDemo.Models.Beer newBeer) { if (newBeer != null) { var beer = business.AddBeer(newBeer); return(Json(beer, JsonRequestBehavior.AllowGet)); } return(new JsonResult()); }
public JsonResult Update(BeerAppDemo.Models.Beer newBeer) { if (newBeer != null) { var beer = business.AddBeer(newBeer); return(Json(beer)); } return(new JsonResult()); }