Beispiel #1
0
 public void UsageGetWithNotSameTypeTest()
 {
     LxDb db = new LxDb(DatabaseFile);
     using (var session = db.OpenSession())
     {
         session.Save("10", new MyContainer
         {
             Name = "MyName",
             Id = 15,
             OtherIds = new List<int> {1, 2, 3}
         });
         // Exception.Message mentions the type that has been stored.
         session.Get<MyOtherContainer>("10");
     }
 }
Beispiel #2
0
 public void UsageRemoveTest()
 {
     LxDb db = new LxDb(DatabaseFile);
     using (var session = db.OpenSession())
     {
         session.Save("10", new MyContainer
         {
             Name = "MyName",
             Id = 15,
             OtherIds = new List<int> {1, 2, 3}
         });
         var retrieved = session.Get<MyContainer>("10");
         CheckExists(retrieved);
         session.Remove("10");
         retrieved = session.Get<MyContainer>("10");
         Assert.IsNull(retrieved);
     }
 }
Beispiel #3
0
 public CredentialStore(string location)
 {
     _db = new LxDb(location);
 }