public CategoriesController(IDeleteCategoryCommand deleteCategoryCommand, IGetCategoryCommand getCategoryCommand, IGetCategoriesCommand getCategoriesCommand, IInsertCategoryCommand insertCategoryCommand, IUpdateCategoryCommand updateCategoryCommand)
 {
     this.deleteCategoryCommand = deleteCategoryCommand;
     this.getCategoryCommand    = getCategoryCommand;
     this.getCategoriesCommand  = getCategoriesCommand;
     this.insertCategoryCommand = insertCategoryCommand;
     this.updateCategoryCommand = updateCategoryCommand;
 }
Esempio n. 2
0
 public CategoriesController(IGetCategoriesCommand getCommand, IGetCategoryCommand getOneCommand, IAddCategoryCommand addCommand, IUpdateCategoryCommand editCommand, IDeleteCategoryCommand deleteCommand)
 {
     _getCommand    = getCommand;
     _getOneCommand = getOneCommand;
     _addCommand    = addCommand;
     _editCommand   = editCommand;
     _deleteCommand = deleteCommand;
 }
 public CategoriesController(IAddCategoryCommand addCommand, IGetCategoriesCommand getCommands, IGetCategoryCommand getCommand, IDeleteCategoryCommand deleteCommand, IUpdateCategoryCommand updateCommand)
 {
     _addCommand    = addCommand;
     _getCommands   = getCommands;
     _getCommand    = getCommand;
     _deleteCommand = deleteCommand;
     _updateCommand = updateCommand;
 }
Esempio n. 4
0
 public void Put(int id, [FromBody] CategoryDto dto, [FromServices] IUpdateCategoryCommand command)
 {
     _executor.ExecuteCommandUpdate(command, dto, id);
 }
 public IActionResult Put(int id, [FromBody] UpdateCategoryDto dto, [FromServices] IUpdateCategoryCommand command)
 {
     dto.Id = id;
     executor.ExecuteCommand(command, dto);
     return(NoContent());
 }
 public IActionResult Put(int id, [FromBody] CategoryDto dto, [FromServices] IUpdateCategoryCommand command)
 {
     dto.Id = id;
     executor.ExecuteCommand(command, dto);
     return(StatusCode(StatusCodes.Status204NoContent));
 }
Esempio n. 7
0
 public void Put([FromForm] CategoryDto dto, [FromServices] IUpdateCategoryCommand command)
 {
     executor.ExecuteCommand(command, dto);
 }