private void SetPurchases(CheckoutViewModel model, Purchase[] userPurchases, Coupon[] userCoupons, IMyMentorRepository repository, CurrencyDto currencyDto) { model.PurchasesForUser = userPurchases.Select(purchase => new CheckoutPurchaseViewModel { Id = purchase.ObjectId, ContentTitlePart1 = GetTitle1(purchase), ContentTitlePart2 = GetTitle2(purchase), ContentName_he_il = GetName_he_il(purchase), ContentName_en_us = GetName_en_us(purchase), HasUnUsedCouopn = CheckUnUsedCouponsForPurchase(purchase, userCoupons), IncludingSupport = purchase.IncludingSupport, RegularPrice = GetPrice(purchase, repository, currencyDto), RegularPriceString = GetPrice(purchase, repository, currencyDto).ToCurrency(model.UserCurrency), PriceWithCoupon = GetPriceWithCoupon(purchase, userCoupons, repository, currencyDto), PriceWithCouponString = GetPriceWithCoupon(purchase, userCoupons, repository, currencyDto).ToCurrency(model.UserCurrency), IsLesson = purchase.ClipKey != null, ContentId = purchase.ClipKey != null ? purchase.ClipKey.ObjectId : purchase.BundleKey.ObjectId, CurrencyId = purchase.UserCurrency.ObjectId, Coupon = CheckCouponForPurchase(purchase, userCoupons), TeacherInfo = new TeacherInfo { Teacher = GetTeacher(purchase), Agent = GetAgent(purchase).ConvertToParseUserDto(), TeacherAdminData = GetTeacherAdminData(purchase), AgentAdminData = GetAgetAdminData(purchase) }, }).ToArray(); }