Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.
Daniel Wertheim edited this page Nov 29, 2012 · 3 revisions

Any() : bool

Returns a bool indicating if there's any structures at all in the structure-set.

using (var session = Database.BeginSession())
{
    return session.Any<Order>();
}

or

using (var session = Database.BeginSession())
{
    return session.Query<Order>().Any();
}

or when doing single query operation:

return db.UseOnceTo().Query<Order>().Any();

Any(expression) : bool

Returns a bool indication if there's any structures at all in the structure-set, that matches the predicate.

using (var session = Database.BeginSession())
{
    return session.Query<Order>().Any(o => o.TotalAmount >= 1000);
}

or when doing single query operation:

return db.UseOnceTo().Query<Order>().Any(o => o.TotalAmount >= 1000);
Clone this wiki locally