本文整理汇总了C#中PagedList.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# PagedList.GetHashCode方法的具体用法?C# PagedList.GetHashCode怎么用?C# PagedList.GetHashCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PagedList
的用法示例。
在下文中一共展示了PagedList.GetHashCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertToSpecificActivities
/// <summary>
/// Converts a paged list of generic activities into a paged list of more specific activity instances
/// </summary>
/// <param name="activities">Paged list of activities where each member may be a specific activity instance e.g. a profile updated activity</param>
/// <param name="pageIndex"> </param>
/// <param name="pageSize"> </param>
/// <returns></returns>
private PagedList<ActivityBase> ConvertToSpecificActivities(PagedList<Activity> activities, int pageIndex, int pageSize)
{
var cacheKey = string.Concat(CacheKeys.Activity.StartsWith, "ConvertToSpecificActivities-", activities.GetHashCode(), "-", pageIndex, "-", pageSize);
return _cacheService.CachePerRequest(cacheKey, () =>
{
var listedResults = ConvertToSpecificActivities(activities);
return new PagedList<ActivityBase>(listedResults, pageIndex, pageSize, activities.Count);
});
}