当前位置: 首页>>代码示例>>C#>>正文


C# Purchase.Select方法代码示例

本文整理汇总了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();
        }
开发者ID:natan1957,项目名称:mymentor-portal,代码行数:29,代码来源:CheckoutController.cs


注:本文中的Purchase.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。