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