public async Task <ICommandResult> Handle(ActionDefineAddCommand mesage) { try { ActionDefine actionDefine = new ActionDefine(); actionDefine.Init(mesage); await _roleService.AddToDb(actionDefine); await _eventSender.Notify(actionDefine.Events); ICommandResult result = new CommandResult { Message = "", ObjectId = actionDefine.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); } }