本文整理汇总了C#中IQuery.SetFirstResult方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.SetFirstResult方法的具体用法?C# IQuery.SetFirstResult怎么用?C# IQuery.SetFirstResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.SetFirstResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupPaging
/// <summary>
/// Sets up NHibernate paging information if pageSize set to a number > 0.
/// </summary>
/// <param name="query">The NHibernate query.</param>
/// <param name="pageSize">The number of database records in each page. If set to 0, then this call does nothing.</param>
/// <param name="pageNumber">The 1-based page number.</param>
protected void SetupPaging(IQuery query, int pageSize, int pageNumber)
{
if (pageSize > 0)
{
query.SetMaxResults(pageSize);
query.SetFirstResult(pageSize * (pageNumber - 1));
}
}
示例2: setQueryProperties
protected void setQueryProperties(IQuery query) {
if (maxResults != null) query.SetMaxResults((int)maxResults);
if (firstResult != null) query.SetFirstResult((int)firstResult);
if (cacheable != null) query.SetCacheable((bool)cacheable);
if (cacheRegion != null) query.SetCacheRegion(cacheRegion);
if (comment != null) query.SetComment(comment);
if (flushMode != null) query.SetFlushMode(flushMode);
if (cacheMode != null) query.SetCacheMode(cacheMode);
if (timeout != null) query.SetTimeout((int)timeout);
if (lockMode != null) query.SetLockMode("e", lockMode);
}
示例3: Apply
/// <summary>
/// Applies this modifier to the query.
/// </summary>
/// <param name="query">The query</param>
public void Apply(IQuery query)
{
query.SetFirstResult(FirstResult);
query.SetMaxResults(MaxResults);
}
示例4: PrepareQueryForPagination
/// <summary>
/// For internal use only.
/// </summary>
private void PrepareQueryForPagination(IQuery query)
{
query.SetFirstResult(pageSize * (currentPage-1));
query.SetMaxResults(pageSize);
}
示例5: OnEvent
public void OnEvent(IQuery query)
{
query.SetFirstResult(firstResult);
}
示例6: commonPrepare
private void commonPrepare(IQuery q){
if (query.MaxCount != 0){
q.SetMaxResults(query.MaxCount);
}
if (query.StartIndex != 0){
q.SetFirstResult(query.StartIndex);
}
}