本文整理汇总了C#中SimpleQuery.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# SimpleQuery.Skip方法的具体用法?C# SimpleQuery.Skip怎么用?C# SimpleQuery.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleQuery
的用法示例。
在下文中一共展示了SimpleQuery.Skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkipShouldSetSkipCount
public void SkipShouldSetSkipCount()
{
var query = new SimpleQuery(null, "foo");
query = query.Skip(42);
Assert.IsNotNull(query.Clauses.OfType<SkipClause>().FirstOrDefault());
Assert.AreEqual(42, query.Clauses.OfType<SkipClause>().First().Count);
}
示例2: GetResult
public virtual async Task<Paged<Entities.Account>> GetResult(Filter.Simple.Data.Filter filter)
{
filter.Resource = "Accounts";
DataStrategy strategy = Database.Open();
var query = new SimpleQuery(strategy, filter.Resource);
var limit = _limit.Apply(filter);
var skip = _skip.Apply(filter);
query = query.Skip(skip)
.Take(limit);
if (filter.HasCondition)
{
query = query.Where(_where.Apply(filter));
}
if (filter.HasOrdering)
{
query = query.OrderBy(_order.Apply(filter), _orderDirection.Apply(filter));
}
var entities = await query.ToList<Entities.Account>();
if (entities == null || !entities.Any())
{
return null;
}
return new Paged<Entities.Account>
{
Limit = limit,
Skip = skip,
Data = entities
};
}
示例3: SkipShouldSetSkipCount
public void SkipShouldSetSkipCount()
{
var query = new SimpleQuery(null, "foo");
query = query.Skip(42);
Assert.AreEqual(42, query.SkipCount);
}