public IActionResult OnPost() { try { service.Create(CreateDto); return(Redirect("./")); } catch (Exception error) { ErrorMessage = error.Message; return(Page()); } }
public ActionResult <Theaters> Create(Theaters theater) { _service.Create(theater); return(CreatedAtRoute("GetTheater", new { id = theater.Id.ToString() }, theater)); }