private D.Payment ConvertToDomain(EF.Payment efPayment) { EF.Beneficiary efBeneficiary = _context.Beneficiaries.FirstOrDefault(b => b.BeneficiaryID == efPayment.BeneficiaryID); EF.Currency efCurrency = _context.Currencies.FirstOrDefault(c => c.CurrencyID == efPayment.CurrencyID); D.Beneficiary beneficiary = new D.Beneficiary(efBeneficiary.Name, efBeneficiary.Description); D.Currency currency = new D.Currency(efCurrency.CurrencyCode, efCurrency.Ratio, efCurrency.ExchangeRate); D.PaymentSource source = new D.PaymentSource(efPayment.PaymentSource.Source); D.PaymentType type = new D.PaymentType(efPayment.PaymentType.Type); string createdBy = _context.Accounts.FirstOrDefault(b => b.AccountID == efPayment.CreatedByID).UserName; string modifiedBy = ""; if (efPayment.ModifiedByID > 0) { modifiedBy = _context.Accounts.FirstOrDefault(b => b.AccountID == efPayment.ModifiedByID).UserName; } return(new D.Payment(efPayment.PaymentID, efPayment.Name, efPayment.Amount, currency, beneficiary, efPayment.Locked, efPayment.Email, efPayment.CreatedDate, efPayment.ModifiedDate, efPayment.PaymentDate, efPayment.PublishDate, createdBy, modifiedBy, source, type, efPayment.OptOut)); }
private Currency convertCurrencyToDomain(EF.Currency efCurrency) { return(new Currency(efCurrency.CurrencyCode, efCurrency.Ratio, efCurrency.ExchangeRate)); }