public static void Create(string dbFile) { DataFactory df = new DataFactory(dbFile, false); using (var sf = df.CreateSessionFactory()) { sf.Close(); } }
public static void AddDocumentSimple(string dbFile, DocumentSimple documentSimple) { DataFactory df = new DataFactory(dbFile, false); using (var sf = df.CreateSessionFactory()) using (var session = sf.OpenSession()) using (var trans = session.BeginTransaction()) { session.SaveOrUpdate(documentSimple.Rating); session.SaveOrUpdate(documentSimple); trans.Commit(); } }