Пример #1
0
 public IActionResult Create([Bind("Id,Name,Comment,Price")] Beer beer)
 {
     if (ModelState.IsValid)
     {
         _repo.Create(beer);
         _repo.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(beer));
 }
 public Beer Create(Beer beer)
 {
     return(_BeerRepository.Create(beer));
 }