public static void MapToExisting(this Domain.BankAccount source, Account target) { if (source == null) { target = null; } else if (target == null) { target = new Account(); } target.AcctNumber = source.AccountNumber; target.AcctType = source.BankAccountType.Map(); target.AcctBalance = source.Balance; source.PrimaryAccountholder.MapToExisting(target.AcctHolder); }
public static Models.Account Map(this Domain.BankAccount source) { if (source == null) { return(null); } var target = new Account { AcctNumber = source.AccountNumber, AcctBalance = source.Balance, AcctType = source.BankAccountType.Map(), AcctHolder = source.PrimaryAccountholder.Map(), }; return(target); }
public static Domain.BankAccount Map(this Account source) { if (source == null) { return(null); } var target = new Domain.BankAccount { AccountNumber = source.AcctNumber, BankAccountType = source.AcctType.MapToAccountType(), Balance = source.AcctBalance, PrimaryAccountholder = source.AcctHolder.Map(), }; return(target); }
private static Domain.BankAccount MapEntityToDomainObject(BankAccountEntity bankAccountEntity) { var balance = bankAccountEntity.TransactionEntities.Sum(x => x.Amount); var bankAccount = new Domain.BankAccount(bankAccountEntity.BankAccountId, balance, bankAccountEntity.Locked); return bankAccount; }