/// <summary> /// Initializes a new instance of the <see cref="ProductController"/> class. /// </summary> /// <param name="hubContext"></param> /// <param name="pageQueryCommand">The page query command</param> /// <param name="getAllCommand">The get all command.</param> /// <param name="getByIdCommand">The get by identifier command.</param> /// <param name="insertCommand">The insert command.</param> /// <param name="updateCommand">The update command.</param> /// <param name="deleteCommand">The delete command.</param> public ProductController(IHubContext <GlobalHub, IGlobalHub> hubContext, IProductPageQueryCommand pageQueryCommand, IProductGetAllCommand getAllCommand, IProductGetByIdCommand getByIdCommand, IProductInsertCommand insertCommand, IProductUpdateCommand updateCommand, IProductDeleteCommand deleteCommand) : base(/*hubContext*/) { this.SignalRHubContext = hubContext; this.PageQueryCommand = pageQueryCommand; this.GetAllCommand = getAllCommand; this.GetByIdCommand = getByIdCommand; this.InsertCommand = insertCommand; this.UpdateCommand = updateCommand; this.DeleteCommand = deleteCommand; }
public IActionResult Delete(int id, [FromServices] IProductDeleteCommand command) { executor.ExecuteCommand(command, id); return(NoContent()); }