Beispiel #1
0
 public ActionResult Create(StadiumViewModel stadium)
 {
     try
     {
         var stadiumDTO = new StadiumDTO {
             Name = stadium.Name
         };
         stadiumService.Create(stadiumDTO);
         return(RedirectToAction("Index"));
     }
     catch (ValidationException ex)
     {
         ModelState.AddModelError(ex.Property, ex.Message);
     }
     return(View(stadium));
 }
Beispiel #2
0
 public CreateStadiumResponse Create([FromBody] CreateStadiumRequest request)
 {
     return(_stadiumService.Create(request));
 }