コード例 #1
0
        public async Task <CommandResult <int> > Handle(UserSaveCommand request, CancellationToken cancellationToken)
        {
            try
            {
                var userId = await _repo.Save(request.Model).ConfigureAwait(false);

                return(await Task.FromResult <CommandResult <int> >(new CommandResult <int>() { Message = "Created successfully", Status = true, ResponseObj = userId }).ConfigureAwait(false));
            }
            catch (System.Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
 public UserViewModel()
 {
     UsrSaveCommand  = new UserSaveCommand(this);
     usrClearCommand = new UserClearCommand(this);
     Roles           = GetAllRoles();
 }