Exemplo n.º 1
0
        public Models.Beer AddBeer(Models.Beer beer)
        {
            BeerDbContext context = new BeerDbContext();

            context.Beers.Add(beer);
            context.SaveChanges();
            return(beer);
        }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
 public JsonResult Update(BeerAppDemo.Models.Beer newBeer)
 {
     if (newBeer != null)
     {
         var beer = business.AddBeer(newBeer);
         return(Json(beer));
     }
     return(new JsonResult());
 }