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


C# UrlHelper.GetPagingLinks方法代码示例

本文整理汇总了C#中System.Web.Mvc.UrlHelper.GetPagingLinks方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.GetPagingLinks方法的具体用法?C# UrlHelper.GetPagingLinks怎么用?C# UrlHelper.GetPagingLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Mvc.UrlHelper的用法示例。


在下文中一共展示了UrlHelper.GetPagingLinks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCollectionFeed

    public virtual AtomFeed GetCollectionFeed(Id collectionId, int pageIndex)
    {
      LogService.Info("AtomPubService.GetCollectionFeed collectionId={0} pageIndex={1}", collectionId, pageIndex);
      Auth(collectionId, AuthAction.GetCollectionFeed);
      AppCollection c = AppServiceRepository.GetService().GetCollection(collectionId);
      EntryCriteria criteria = new EntryCriteria()
      {
        WorkspaceName = collectionId.Workspace,
        CollectionName = collectionId.Collection,
        Authorized = true,
        SortMethod = SortMethod.EditDesc //according to spec, collection feeds should be ordered by edited
      };
      int total;
      AtomFeed feed = AtomFeed.BuildFeed(c, AtomEntryRepository.GetEntries(criteria, pageIndex, c.PageSize, out total),
        total);//, pageIndex, c.PageSize, RouteFunc, "AtomPubCollection", "AtomPubCollectionIndex", true);
      SetLinks(feed);

      var url = new UrlHelper(Container.GetInstance<RequestContext>());
      feed.Links = feed.Links.Concat(url.GetPagingLinks("AtomPubCollection", feed.Id, null, feed.TotalResults ?? 0, pageIndex, c.PageSize,
        Atom.ContentTypeFeed, AbsoluteMode.Force));
      return feed;
    }
开发者ID:erikzaadi,项目名称:atomsitethemes.erikzaadi.com,代码行数:22,代码来源:AtomPubService.cs

示例2: GetFeed

    public virtual AtomFeed GetFeed(Id collectionId, int pageIndex, int pageSize)
    {
      //<atom:link rel="alternate" type="text/html" href="https://atomsite.net/blog.xhtml" />

      LogService.Info("AtomPubService.GetFeed collectionId={0}", collectionId);
      Auth(collectionId, AuthAction.GetFeed);
      AppCollection c = AppServiceRepository.GetService().GetCollection(collectionId);
      EntryCriteria criteria = new EntryCriteria()
      {
        WorkspaceName = collectionId.Workspace,
        CollectionName = collectionId.Collection,
        Authorized = AuthorizeService.IsAuthorized(GetUser(), collectionId.ToScope(), AuthAction.GetEntryOrMedia),
      };
      int total;
      AtomFeed feed = AtomFeed.BuildFeed(c, AtomEntryRepository.GetEntries(criteria, pageIndex, pageSize, out total),
        total);//, pageIndex, pageSize, RouteFunc, "AtomPubFeed", "AtomPubCollectionIndex", true);

      var url = new UrlHelper(Container.GetInstance<RequestContext>());
      feed.Links = feed.Links.Concat(url.GetPagingLinks("AtomPubFeed", feed.Id, null, feed.TotalResults ?? 0, 
        pageIndex, pageSize,Atom.ContentTypeFeed, AbsoluteMode.Force));

      SetLinks(feed);
      return feed;
    }
开发者ID:erikzaadi,项目名称:atomsitethemes.erikzaadi.com,代码行数:24,代码来源:AtomPubService.cs


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