/// <summary> /// Assign values from <see cref="IAccount"/> to JSON <see cref="Account"/>. /// For expended objects need add assign values /// </summary> /// <param name="account">JSON <see cref="Account"/></param> /// <param name="data"><see cref="IAccount"/></param> protected virtual Account OnToAccountConvert(Account account, IAccount data) { account.Contacts = data.Contacts?.ToArray(); account.Status = data.Status; account.TermsOfServiceAgreed = data.TermsOfServiceAgreed; account.Key = data.Key; account.CreatedAt = data.CreatedAt; account.Orders = new Uri(new Uri(Options.BaseAddress), "orders").ToString(); if (data.ExternalAccountId != null) { account.ExternalAccountBinding = ExternalAccountRepository.GetById(data.ExternalAccountId.Value).Account; } return(account); }
public async Task <IResult <ExternalAccountRepository> > ExternalAccountFindAsync(ExternalAccountRepository externalAccountRepository) { ProxyXFMAccount.ExternalAccountRepositoryInput input = new ProxyXFMAccount.ExternalAccountRepositoryInput(); input.ExternalAccountRepository = AutoMapper.Mapper.Map <ProxyXFMAccount.ExternalAccountRepository>(externalAccountRepository); input.InputContext = this.UpdateContext <ProxyXFMAccount.Context>(); var result = await InvokeMethodAsync <Domain.Account.ExternalAccountRepository, ProxyXFMAccount.WSAccountClient>("ExternalAccountFind", input); return(result); }