Ejemplo n.º 1
0
 public IActionResult Put(int id, [FromBody] BeerModel beerModel)
 {
     try
     {
         Beer beer = beerModel.ToEntity();
         beer.Id = id;
         logic.Update(beer);
         return(Ok());
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
Ejemplo n.º 2
0
        public IActionResult Post(BeerModel beer)
        {
            Beer newBeer = logic.Add(beer.ToEntity(), beer.BeerFactoryId);

            return(Ok(newBeer));
        }