本文整理汇总了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;
}
示例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;
}