public async Task <OperationResultResponse <bool> > Edit(
     [FromServices] IEditNewsCommand command,
     [FromQuery] Guid newsId,
     [FromBody] JsonPatchDocument <EditNewsRequest> request)
 {
     return(await command.ExecuteAsync(newsId, request));
 }
 public NewsController(IGetNewsCommand getNewsCommand, IGetNewCommand getNewCommand, IAddNewsCommand addNewsCommand, IDeleteNewsCommand deleteNewsCommand, IEditNewsCommand editNewsCommand)
 {
     _getNewsCommand    = getNewsCommand;
     _getNewCommand     = getNewCommand;
     _addNewsCommand    = addNewsCommand;
     _deleteNewsCommand = deleteNewsCommand;
     _editNewsCommand   = editNewsCommand;
 }
Exemple #3
0
 public NewsController(IGetNewsCommand getNewsCommand, IGetNewCommand getNewCommand, IAddNewsCommand addNewsCommand, IEditNewsCommand editNewsCommand, IDeleteNewsCommand deleteNewsCommand, IGetCategoriesCommand getCategoriesCommand, IHostingEnvironment hostingEnvironment, UserDto user)
 {
     _getNewsCommand       = getNewsCommand;
     _getNewCommand        = getNewCommand;
     _addNewsCommand       = addNewsCommand;
     _editNewsCommand      = editNewsCommand;
     _deleteNewsCommand    = deleteNewsCommand;
     _getCategoriesCommand = getCategoriesCommand;
     _hostingEnvironment   = hostingEnvironment;
     _user = user;
 }