Beispiel #1
0
 public IActionResult Create([Bind("Id,Name,Description,Price")] Side side)
 {
     if (ModelState.IsValid)
     {
         _context.CreateSide(side);
         return(RedirectToAction(nameof(Index)));
     }
     return(View(side));
 }
 public ActionResult <Side> CreateSide([FromBody] Side newSide)
 {
     try
     {
         return(Ok(_ss.CreateSide(newSide)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }