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

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