Created
October 21, 2010 02:17
-
-
Save ecavazos/637805 to your computer and use it in GitHub Desktop.
example session factory usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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