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


C# ContentManagement.VersionOptions类代码示例

本文整理汇总了C#中Orchard.ContentManagement.VersionOptions的典型用法代码示例。如果您正苦于以下问题:C# VersionOptions类的具体用法?C# VersionOptions怎么用?C# VersionOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VersionOptions类属于Orchard.ContentManagement命名空间,在下文中一共展示了VersionOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetForumsForCategory

        public IEnumerable<ForumPart> GetForumsForCategory(ForumCategoryPart forumCategoryPart, int skip, int count, VersionOptions versionOptions)
        {
            
            var forums = _contentManager.Query<ForumPart, ForumPartRecord>(versionOptions)
                .OrderBy(fp => fp.Weight)
                .WithQueryHints(new QueryHints().ExpandRecords<CommonPartRecord, TitlePartRecord>())
                .Join<CommonPartRecord>()
                .Where(cpr => cpr.Container.Id == forumCategoryPart.Id).Slice(skip, count).ToList();

            /*
             * var forumIds = _categoryToForumMappingRepository.Table.Where(rec => rec.ForumCategoryPartRecord.Id == forumCategoryPart.Id).Select(rec => rec.ForumPartRecord.Id).ToList();
            var forums = _contentManager.Query<ForumPart, ForumPartRecord>(versionOptions).OrderByDescending(fpr => fpr.Weight).Where(forum => forumIds.Contains(forumCategoryPart.Id)).Slice(skip, count).ToList();
             */

            /*
            return GetParentQuery(forumCategoryPart, versionOptions)
                .Join<ThreadPartRecord>()
                .OrderByDescending(o => o.IsSticky)
                .Join<CommonPartRecord>()
                .OrderByDescending(o => o.ModifiedUtc)
                .ForPart<ThreadPart>()
                .Slice(skip, count)
                .ToList();
             */

            return forums;
        }
开发者ID:jon123,项目名称:NGM.Forum,代码行数:27,代码来源:ForumCategoryService.cs

示例2: Get

 public IEnumerable<ForumPart> Get(VersionOptions versionOptions)
 {
     return _contentManager.Query<ForumPart, ForumPartRecord>(versionOptions)
         .Join<RoutePartRecord>()
         .OrderBy(br => br.Title)
         .List();
 }
开发者ID:Trifectgaming,项目名称:Trifect-CMS,代码行数:7,代码来源:ForumService.cs

示例3: Get

 public IEnumerable<HotelPart> Get(
     DestinationPart destinationPart, int skip, int count, VersionOptions versionOptions)
 {
     return
         GetHotelQuery(destinationPart, versionOptions).Slice(skip, count).ToList().Select(
             ci => ci.As<HotelPart>());
 }
开发者ID:ThinkPublishing,项目名称:Summit.Core,代码行数:7,代码来源:HotelService.cs

示例4: Get

 public PostPart Get(int id, VersionOptions versionOptions) {
     return _contentManager.Query<PostPart, PostPartRecord>(versionOptions)
         .WithQueryHints(new QueryHints().ExpandRecords<CommonPartRecord>())
         .Where(x => x.Id == id)
         .List()
         .SingleOrDefault();
 }
开发者ID:jon123,项目名称:NGM.Forum,代码行数:7,代码来源:PostService.cs

示例5: GetPositional

        public PostPart GetPositional(ThreadPart threadPart, bool includeInappropriate, VersionOptions versionOptions,
                                      ThreadPostPositional positional) {
            var query = GetParentQuery(threadPart, versionOptions);

            if (positional == ThreadPostPositional.First)
                query = query.OrderBy(o => o.PublishedUtc);

            if (positional == ThreadPostPositional.Latest)
                query = query.OrderByDescending(o => o.PublishedUtc );

            if (!includeInappropriate)
            {
                var postPart = query.Join<PostPartRecord>().Where(post => post.IsInappropriate == false);
                return postPart
                .ForPart<PostPart>()
                .Slice(1)
                .SingleOrDefault();
            }
            // else 

            return query.ForPart<PostPart>()
                .Slice(1)
                .SingleOrDefault();


        }
开发者ID:jon123,项目名称:NGM.Forum,代码行数:26,代码来源:PostService.cs

示例6: Get

 public IEnumerable<BlogPostPart> Get(BlogPart blogPart, int skip, int count, VersionOptions versionOptions)
 {
     return GetBlogQuery(blogPart, versionOptions)
             .Slice(skip, count)
             .ToList()
             .Select(ci => ci.As<BlogPostPart>());
 }
开发者ID:Log-of-e,项目名称:orchard_cms_view_code,代码行数:7,代码来源:BlogPostService.cs

示例7: Get

 public BlogPostPart Get(BlogPart blogPart, string slug, VersionOptions versionOptions) {
     var postPath = blogPart.As<IRoutableAspect>().GetChildPath(slug);
     return
         _contentManager.Query(versionOptions, "BlogPost").Join<RoutePartRecord>().Where(rr => rr.Path == postPath).
             Join<CommonPartRecord>().Where(cr => cr.Container == blogPart.Record.ContentItemRecord).List().
             SingleOrDefault().As<BlogPostPart>();
 }
开发者ID:rupertwhitlock,项目名称:IncreasinglyAbsorbing,代码行数:7,代码来源:BlogPostService.cs

示例8: Get

 public IEnumerable<ForumPart> Get(VersionOptions versionOptions) {
     return _contentManager.Query<ForumPart, ForumPartRecord>(versionOptions)
         .WithQueryHints(new QueryHints().ExpandRecords<AutoroutePartRecord, TitlePartRecord, CommonPartRecord>())
         .OrderBy(o => o.Weight)
         .List()
         .ToList();
 }
开发者ID:six006,项目名称:NGM.Forum,代码行数:7,代码来源:ForumService.cs

示例9: Get

 public TimetableAppointmentPart Get(TimetablePart TimetablePart, string slug, VersionOptions versionOptions) {
     var postSlug = TimetablePart.As<IRoutableAspect>().GetChildPath(slug);
     return
         _contentManager.Query(versionOptions, "TimetableAppointment").Join<RoutePartRecord>().Where(rr => rr.Path == postSlug).
             Join<CommonPartRecord>().Where(cr => cr.Container == TimetablePart.Record.ContentItemRecord).List().
             SingleOrDefault().As<TimetableAppointmentPart>();
 }
开发者ID:dminik,项目名称:voda_code,代码行数:7,代码来源:TimetableAppointmentService.cs

示例10: Get

 public IEnumerable<SeasonPart> Get(VersionOptions versionOptions)
 {
     return _contentManager.Query<SeasonPart, SeasonPartRecord>(versionOptions)
         .Join<TitlePartRecord>()
         .OrderBy(br => br.Title)
         .List();
 }
开发者ID:pavelvolek,项目名称:SYBA.ObalRoku,代码行数:7,代码来源:SeasonService.cs

示例11: Get

 public IEnumerable<ThreadPart> Get(ForumPart forumPart, VersionOptions versionOptions)
 {
     return GetForumQuery(forumPart, versionOptions)
         .OrderByDescending(cr => cr.CreatedUtc)
         .ForPart<ThreadPart>()
         .List();
 }
开发者ID:Trifectgaming,项目名称:Trifect-CMS,代码行数:7,代码来源:ThreadService.cs

示例12:

        IEnumerable<LocalizationPart> ILocalizationService.GetLocalizations(IContent content, VersionOptions versionOptions) {
            if (content.ContentItem.Id == 0)
                return Enumerable.Empty<LocalizationPart>();

            var localized = content.As<LocalizationPart>();

            var query = versionOptions == null
                ? _contentManager.Query<LocalizationPart>(localized.ContentItem.ContentType)
                : _contentManager.Query<LocalizationPart>(versionOptions, localized.ContentItem.ContentType);

            int contentItemId = localized.ContentItem.Id;

            if (localized.HasTranslationGroup) {
                int masterContentItemId = localized.MasterContentItem.ContentItem.Id;

                query = query.Where<LocalizationPartRecord>(l =>
                    l.Id != contentItemId // Exclude the content
                    && (l.Id == masterContentItemId || l.MasterContentItemId == masterContentItemId));
            }
            else {
                query = query.Where<LocalizationPartRecord>(l =>
                    l.MasterContentItemId == contentItemId);
            }

            // Warning: May contain more than one localization of the same culture.
            return query.List().ToList();
        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:27,代码来源:LocalizationService.cs

示例13: GetFormPartByName

 public OFormPart GetFormPartByName(string name, VersionOptions options)
 {
     return _contentManager.Query<OFormPart, OFormPartRecord>(options)
         .Where(f => f.Name == name)
         .List()
         .FirstOrDefault();
 }
开发者ID:homastudio,项目名称:SnagIt,代码行数:7,代码来源:OFormService.cs

示例14: GetWidgets

 public IEnumerable<WidgetExPart> GetWidgets(int hostId, VersionOptions versionOptions = null) {
     versionOptions = versionOptions ?? VersionOptions.Published;
     return _contentManager
         .Query<WidgetExPart, WidgetExPartRecord>()
         .ForVersion(versionOptions)
         .Where(x => x.HostId == hostId)
         .List();
 }
开发者ID:BedeGaming,项目名称:IDeliverable.Widgets,代码行数:8,代码来源:WidgetManager.cs

示例15: GetTaggedContentItemCount

 public int GetTaggedContentItemCount(int tagId, VersionOptions options)
 {
     return _orchardServices.ContentManager
         .Query<TagsPart, TagsPartRecord>()
         .Where(tpr => tpr.Tags.Any(tr => tr.TagRecord.Id == tagId))
         .Join<MediaPartRecord>()
         .Count();
 }
开发者ID:davegardner,项目名称:Cascade.Photoswipe,代码行数:8,代码来源:PhotoSwipeService.cs


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