本文整理汇总了C#中Purchase.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Purchase.Select方法的具体用法?C# Purchase.Select怎么用?C# Purchase.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPurchases
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();
}