Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created April 14, 2012 09:10
Show Gist options
  • Select an option

  • Save danielwertheim/2383056 to your computer and use it in GitHub Desktop.

Select an option

Save danielwertheim/2383056 to your computer and use it in GitHub Desktop.
Named queries
using (var session = database.BeginSession())
{
session.Advanced.UpsertNamedQuery<Customer>("CustomersViaSP", qb => qb.Where(c =>
c.CustomerNo >= default(int)
&& c.CustomerNo <= default(int)
&& c.DeliveryAddress.Street == string.Empty));
}
using (var session = database.BeginSession())
{
var result = session.Advanced.NamedQuery<Customer>("CustomersViaSP", c =>
c.CustomerNo >= 500
&& c.CustomerNo <= 550
&& c.DeliveryAddress.Street == "Some street"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment