예제 #1
0
 public IActionResult Post([FromBody] CreateGenreDTO request)
 {
     try
     {
         createGenre.Execute(request);
         return(StatusCode(201));
     }
     catch (EntityAlreadyExist e)
     {
         return(StatusCode(409, e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(500, "Greska"));
     }
 }
예제 #2
0
 public IActionResult Post([FromBody] GenreDto obj)
 {
     try
     {
         _createGenre.Execute(obj);
         return(StatusCode(201));
     }
     catch (EntityAlreadyExistException)
     {
         return(Conflict());
     }
     catch
     {
         return(StatusCode(500, "Internal Server Error!"));
     }
 }