public async Task <ICommandResult> Handle(AttrCategoryRemoveCommand mesage) { try { AttrCategory attrCategory = new AttrCategory(); attrCategory.Remove(mesage); await _attrCategoryService.RemoveToDb(attrCategory); ICommandResult result = new CommandResult() { Message = "", ObjectId = attrCategory.Id, Status = CommandResult.StatusEnum.Sucess }; return(result); } catch (Exception e) { e.Data["Param"] = mesage; ICommandResult result = new CommandResult() { Message = e.Message, Status = CommandResult.StatusEnum.Fail }; return(result); } }
public async Task <CommandResult> SendCommand(AttrCategoryRemoveCommand command) { CommandResult commandResult = await _commandService.SendAndReceiveResult <CommandResult>(command); return(commandResult); }
public void Remove(AttrCategoryRemoveCommand command) { AttributeId = command.AttributeId; CategoryId = command.CategoryId; RemoveEvent(); }