Пример #1
0
        public Models.Beer AddBeer(Models.Beer beer)
        {
            BeerDbContext context = new BeerDbContext();

            context.Beers.Add(beer);
            context.SaveChanges();
            return(beer);
        }
Пример #2
0
 public JsonResult Edit(BeerAppDemo.Models.Beer newBeer)
 {
     if (newBeer != null)
     {
         var beer = business.AddBeer(newBeer);
         return(Json(beer, JsonRequestBehavior.AllowGet));
     }
     return(new JsonResult());
 }
Пример #3
0
 public JsonResult Update(BeerAppDemo.Models.Beer newBeer)
 {
     if (newBeer != null)
     {
         var beer = business.AddBeer(newBeer);
         return(Json(beer));
     }
     return(new JsonResult());
 }