public static DiscountEntity ToDataModel(this coreModel.Discount discount, PrimaryKeyResolvingMap pkMap) { if (discount == null) { throw new ArgumentNullException("discount"); } var retVal = new DiscountEntity(); pkMap.AddPair(discount, retVal); retVal.InjectFrom(discount); retVal.Currency = discount.Currency.ToString(); retVal.CouponCode = discount.Coupon; return(retVal); }
public static DiscountEntity ToDataModel(this Discount discount) { if (discount == null) { throw new ArgumentNullException("discount"); } var retVal = new DiscountEntity(); retVal.InjectFrom(discount); if (discount.Currency != null) { retVal.Currency = discount.Currency.ToString(); } if (discount.Coupon != null) { retVal.CouponCode = discount.Coupon.Code; retVal.CouponInvalidDescription = discount.Coupon.InvalidDescription; } return(retVal); }