public static coreModel.QuoteItem ToCoreModel(this dataModel.QuoteItemEntity dbEntity) { if (dbEntity == null) throw new ArgumentNullException("dbEntity"); var retVal = new coreModel.QuoteItem(); retVal.InjectFrom(dbEntity); retVal.Currency = (CurrencyCodes)Enum.Parse(typeof(CurrencyCodes), dbEntity.Currency); retVal.ProposalPrices = dbEntity.ProposalPrices.Select(x => x.ToCoreModel()).ToList(); return retVal; }
public static coreModel.QuoteItem ToCoreModel(this dataModel.QuoteItemEntity dbEntity) { if (dbEntity == null) { throw new ArgumentNullException("dbEntity"); } var retVal = new coreModel.QuoteItem(); retVal.InjectFrom(dbEntity); retVal.Currency = (CurrencyCodes)Enum.Parse(typeof(CurrencyCodes), dbEntity.Currency); retVal.ProposalPrices = dbEntity.ProposalPrices.Select(x => x.ToCoreModel()).ToList(); return(retVal); }
public static coreModel.QuoteItem ToCoreModel(this webModel.QuoteItem quoteItem) { var retVal = new coreModel.QuoteItem(); retVal.InjectFrom(quoteItem); retVal.Currency = quoteItem.Currency; if (quoteItem.ProposalPrices != null) { retVal.ProposalPrices = quoteItem.ProposalPrices.Select(x => x.ToCoreModel()).ToList(); } if (quoteItem.SelectedTierPrice != null) { retVal.SelectedTierPrice = quoteItem.SelectedTierPrice.ToCoreModel(); } return retVal; }
public static coreModel.QuoteItem ToCoreModel(this webModel.QuoteItem quoteItem) { var retVal = new coreModel.QuoteItem(); retVal.InjectFrom(quoteItem); retVal.Currency = quoteItem.Currency; if (quoteItem.ProposalPrices != null) { retVal.ProposalPrices = quoteItem.ProposalPrices.Select(x => x.ToCoreModel()).ToList(); } if (quoteItem.SelectedTierPrice != null) { retVal.SelectedTierPrice = quoteItem.SelectedTierPrice.ToCoreModel(); } return(retVal); }