Beispiel #1
0
 public IActionResult OnPost()
 {
     try
     {
         service.Create(CreateDto);
         return(Redirect("./"));
     }
     catch (Exception error)
     {
         ErrorMessage = error.Message;
         return(Page());
     }
 }
Beispiel #2
0
        public ActionResult <Theaters> Create(Theaters theater)
        {
            _service.Create(theater);

            return(CreatedAtRoute("GetTheater", new { id = theater.Id.ToString() }, theater));
        }