public PublishersController(MyComicListContext context, IGetPublishers getCommand, IAddPublisher addCommand, IUpdatePublisher updateCommand, IDeletePublisher deleteCommand) { Context = context; this.getCommand = getCommand; this.addCommand = addCommand; this.updateCommand = updateCommand; this.deleteCommand = deleteCommand; }
public IActionResult Put(int id, [FromBody] PublisherDto dto, [FromServices] IUpdatePublisher command) { dto.Id = id; _executor.ExecuteCommand(command, dto); return(NoContent()); }