Skip to content

Instantly share code, notes, and snippets.

@ecavazos
Created October 21, 2010 02:17
Show Gist options
  • Save ecavazos/637805 to your computer and use it in GitHub Desktop.
Save ecavazos/637805 to your computer and use it in GitHub Desktop.
example session factory usage
public class SampleClass
{
private readonly ISessionFactory _sessionFactory;
public SampleController(ISessionFactory sessionFactory) {
_sessionFactory = sessionFactory;
}
public void DoSomething() {
using(var session = _sessionFactory.OpenSession()) {
var foos = session.Linq<FooEntity>().ToList();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment