本文整理匯總了C#中Microsoft.WindowsAzure.Storage.Table.TableQuery.Take方法的典型用法代碼示例。如果您正苦於以下問題:C# TableQuery.Take方法的具體用法?C# TableQuery.Take怎麽用?C# TableQuery.Take使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.WindowsAzure.Storage.Table.TableQuery
的用法示例。
在下文中一共展示了TableQuery.Take方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FetchEntities
protected async Task<IList<IDictionary<string, object>>> FetchEntities(string filter)
{
Require.NotEmpty(filter, "filter");
var query = new TableQuery<DynamicTableEntity>()
.Select(m_properties)
.Where(filter);
List<IDictionary<string, object>> result;
if (m_take.HasValue)
{
query = query.Take(m_take.Value);
result = new List<IDictionary<string, object>>(m_take.Value);
}
else
{
result = new List<IDictionary<string, object>>();
}
var queryResult = await m_fetchEntities(query, m_continuationToken);
result.AddRange(queryResult.Results.Select(m_tableEntityConverter.CreatePropertiesFromDynamicTableEntity));
m_continuationToken = queryResult.ContinuationToken;
m_executionStarted = true;
return result;
}
示例2: GenerateListTablesQuery
private TableQuery GenerateListTablesQuery(string prefix, int? maxResults)
{
TableQuery query = new TableQuery();
if (!string.IsNullOrEmpty(prefix))
{
// Append Max char to end '{' is 1 + 'z' in AsciiTable
string uppperBound = prefix + '{';
query = query.Where(TableQuery.CombineFilters(
TableQuery.GenerateFilterCondition(TableConstants.TableName, QueryComparisons.GreaterThanOrEqual, prefix),
TableOperators.And,
TableQuery.GenerateFilterCondition(TableConstants.TableName, QueryComparisons.LessThan, uppperBound)));
}
if (maxResults.HasValue)
{
query = query.Take(maxResults.Value);
}
return query;
}