public GenresController(MyComicListContext context, IAddGenre addCommand, IUpdateGenre updateCommand, IDeleteGenre deleteCommand) { Context = context; this.addCommand = addCommand; this.updateCommand = updateCommand; this.deleteCommand = deleteCommand; }
public IActionResult Put(int id, [FromBody] GenreDto dto, [FromServices] IUpdateGenre command) { dto.Id = id; executor.ExecuteCommand(command, dto); return(StatusCode(StatusCodes.Status204NoContent)); }