Example #1
0
 public GenresController(IAddGenreCommand addGenre, IGetGenresCommand getGenres, IGetGenreCommand getGenre, IEditGenreCommand editGenre, IDeleteGenreCommand deleteGenre)
 {
     this.addGenre    = addGenre;
     this.getGenres   = getGenres;
     this.getGenre    = getGenre;
     this.editGenre   = editGenre;
     this.deleteGenre = deleteGenre;
 }
Example #2
0
 public GenreController(IGetGenreCommand getGenres, IGetOneGenreCommand getOneGenre, ICreateGenreCommand createGenre, IDeleteGenreCommand deleteGenre, IUpdateGenreCommand updateGenre)
 {
     _getGenres   = getGenres;
     _getOneGenre = getOneGenre;
     _createGenre = createGenre;
     _deleteGenre = deleteGenre;
     _updateGenre = updateGenre;
 }
Example #3
0
 public GenresController(IGetGenresCommand getGenres, IGetGenreCommand getGenre, IAddGenreCommand addGenre, IEditGenreCommand editGenre, IDeleteGenreCommand deleteGenre, UseCaseExecutor executor)
 {
     this.getGenres   = getGenres;
     this.getGenre    = getGenre;
     this.addGenre    = addGenre;
     this.editGenre   = editGenre;
     this.deleteGenre = deleteGenre;
     this.executor    = executor;
 }
 public IActionResult Delete(int id,
                             [FromServices] IDeleteGenreCommand command)
 {
     try
     {
         _executor.ExecuteCommand(command, id);
         return(StatusCode(StatusCodes.Status204NoContent));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #5
0
 public void Delete(int id,
                    [FromServices] IDeleteGenreCommand command)
 {
     _executor.ExecuteCommand(command, id);
 }
 public IActionResult Delete(int id, [FromServices] IDeleteGenreCommand command)
 {
     executor.ExecuteCommand(command, id);
     return(NoContent());
 }
Example #7
0
 public IActionResult Delete(int id, [FromServices] IDeleteGenreCommand command)
 {
     _executor.ExecuteCommand(command, id);
     return(StatusCode(StatusCodes.Status204NoContent));
 }