main
1using gorilla.commons.utility;
2
3namespace momoney.database.transactions
4{
5 public interface ISessionFactory : Factory<ISession> {}
6
7 public class SessionFactory : ISessionFactory
8 {
9 readonly IDatabase database;
10 readonly IChangeTrackerFactory factory;
11
12 public SessionFactory(IDatabase database, IChangeTrackerFactory factory)
13 {
14 this.database = database;
15 this.factory = factory;
16 }
17
18 public ISession create()
19 {
20 return new Session(new Transaction(database, factory), database);
21 }
22 }
23}