Пример #1
0
 public static AccountRegistrationModel DomainToInfrastructure(this Core.Models.AccountRegistrationModel @this)
 {
     return(new AccountRegistrationModel
     {
         ConfirmCallbackUrl = @this.ConfirmCallbackUrl,
         Email = @this.Email,
         FirstName = @this.FirstName,
         LastName = @this.LastName,
         Password = @this.Password,
         Username = @this.Username
     });
 }
Пример #2
0
        public async Task <CommandResult <AccountCreatedResponseModel> > RegistrationAsync(Core.Models.AccountRegistrationModel model)
        {
            string uri = API.Account.Registration(_baseAccountUrl);

            var result = await CommandFactory.Instance.GetCommand("BASE_POST_COMMAND").RunAsync <AccountCreatedModel>(uri, model.DomainToInfrastructure());

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

                return(commandResult);
            }

            return(null);
        }