本文整理汇总了C#中Dialect.GetLimitValue方法的典型用法代码示例。如果您正苦于以下问题:C# Dialect.GetLimitValue方法的具体用法?C# Dialect.GetLimitValue怎么用?C# Dialect.GetLimitValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialect
的用法示例。
在下文中一共展示了Dialect.GetLimitValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLimitUsingDialect
/// <summary>
/// Performs dialect-specific manipulations on the limit value before returning it.
/// This method is applicable for use in limit statements only.
/// </summary>
internal static int? GetLimitUsingDialect(RowSelection selection, Dialect.Dialect dialect)
{
if (selection == null || selection.MaxRows == RowSelection.NoValue)
return null;
return dialect.GetLimitValue(GetFirstRow(selection), selection.MaxRows);
}
示例2: GetMaxOrLimit
/// <summary>
/// Some dialect-specific LIMIT clauses require the maximium last row number
/// (aka, first_row_number + total_row_count), while others require the maximum
/// returned row count (the total maximum number of rows to return).
/// </summary>
/// <param name="selection">The selection criteria </param>
/// <param name="dialect">The dialect </param>
/// <returns> The appropriate value to bind into the limit clause. </returns>
internal static int GetMaxOrLimit(Dialect.Dialect dialect, RowSelection selection)
{
int firstRow = GetFirstRow(selection);
int rowCount = selection.MaxRows;
if (rowCount == RowSelection.NoValue)
return int.MaxValue;
return dialect.GetLimitValue(firstRow, rowCount);
}
示例3: GetPagingValue
protected object GetPagingValue(object value, Dialect.Dialect dialect, QueryParameters queryParameters)
{
if (isTakeParameter)
{
int skipParameterValue = 0;
if (skipParameter != null)
skipParameterValue = skipParameter.GetSkipValue(queryParameters);
return dialect.GetLimitValue(skipParameterValue , (int)value);
}
if (isSkipParameter)
return dialect.GetOffsetValue((int)value);
return value;
}