/// <summary> /// Open a persistence session. /// </summary> public virtual void OpenSession() { if (IsSessionOpened) { throw new InvalidOperationException("MemoDb session already open"); } var session = Memo.CreateSession(); CurrentSession = session; }
static DataWrapper() { Db = new Memo(); Db.Map <SampleEntity>(); // populate in-memory database using (var s = Db.CreateSession()) { Array.ForEach(SampleEntity.GetSampleEntities().ToArray(), e => s.Insert(e)); s.Flush(); } }