コード例 #1
0
 public static AccountLoginModel DomainToInfrastructure(this Core.Models.AccountLoginModel @this)
 {
     return(new AccountLoginModel
     {
         Username = @this.Username,
         Password = @this.Password,
         RememberMe = @this.RememberMe
     });
 }
コード例 #2
0
        public async Task <CommandResult <JwtTokenModel> > SingUpAsync(Core.Models.AccountLoginModel model)
        {
            var result = await CommandFactory.Instance.GetCommand("LOGIN").RunAsync <TokenModel>(model.DomainToInfrastructure());

            if (result != null)
            {
                CommandResult <JwtTokenModel> commandResult = new CommandResult <JwtTokenModel>();
                commandResult.Code     = (int)result.ResponseCode;
                commandResult.Value    = result.Value?.InfrastructureToDomain();
                commandResult.Error    = result.Error;
                commandResult.Response = result.Response;

                return(commandResult);
            }

            return(null);
        }