public async Task <MessageModel <object> > RegisterAsync(SerilogView serilogView)
        {
            // 视图模型验证
            if (!ModelState.IsValid)
            {
                return new MessageModel <object>()
                       {
                           Success = ModelState.IsValid, Message = string.Join(",", ModelState.Values), Data = serilogView
                       }
            }
            ;

            // 执行添加方法
            await _SerilogService.RegisterAsync(serilogView);

            // 消息通知
            if (base.Notifications.HasErrorNotifications())
            {
                return new MessageModel <object>()
                       {
                           Success = false,
                           Message = "Error",
                           //Data = await _OpenCardUserInfoAppService.RetrieveAsync(w => w.CitizenIdNumber == openCardUserInfoView.CitizenIdNumber)
                       }
            }
            ;
            return(new MessageModel <object>()
            {
                Success = true,
                Message = "Ok",
                //Data = await _OpenCardUserInfoAppService.RetrieveAsync(w => w.CitizenIdNumber == openCardUserInfoView.CitizenIdNumber)
            });
        }
Exemple #2
0
 public async Task RegisterAsync(SerilogView serilogView)
 {
     // 这里引入领域设计中的写命令
     var registerCommand = _Mapper.Map <RegisterSerilogCommand>(serilogView);
     await _Bus.SendIntCommand(registerCommand);
 }