public Task <bool> Handle(InsertNewApprovalCommand request, CancellationToken cancellationToken) { if (!request.IsValid()) { NotifyValidationErrors(request); return(Task.FromResult(false)); } var approval = new ApprovalEntity(Guid.NewGuid() , request.CategoryId , request.Subject , request.Description , request.EmailApproval , DateTime.Now); _approvalRepository.Add(approval); if (Commit()) { Bus.RaiseEvent(new ApprovalInsertEvent(approval.Id , approval.CategoryId , approval.Subject , approval.Description , approval.EmailApproval , approval.DateCreate)); } return(Task.FromResult(true)); }