public GenresController(MyComicListContext context, IAddGenre addCommand, IUpdateGenre updateCommand, IDeleteGenre deleteCommand)
 {
     Context            = context;
     this.addCommand    = addCommand;
     this.updateCommand = updateCommand;
     this.deleteCommand = deleteCommand;
 }
        // ctor
        public AddGenrePresenter(IAddGenre v)
        {
            // set IView
            view = v;

            //instantiate IModel
            model = new AddGenreModel();

            // wireup view events
            SubscribeToViewEvents();

            // init model
            model.M_GenreId   = "";
            model.M_GenreName = "";

            ApplicationModel.NoChanges = true;
        }
Exemple #3
0
 public IActionResult Post([FromBody] GenreDto dto, [FromServices] IAddGenre command)
 {
     executor.ExecuteCommand(command, dto);
     return(StatusCode(StatusCodes.Status201Created));
 }