public virtual void Init() { using (var db = TrustchainDatabase.Open()) { // Make sure that the in memory database exist db.CreateIfNotExist(); } }
public void TestPut() { using (var db = TrustchainDatabase.Open()) { Assert.IsTrue(db.KeyValue.Put("test", "test") == 1); Assert.IsTrue(db.KeyValue.Count() == 1); } }
public void TestDelete() { using (var db = TrustchainDatabase.Open()) { Assert.IsTrue(db.KeyValue.Put("test", "test") == 1); Assert.IsTrue(db.KeyValue.Get("test") == "test"); Assert.IsTrue(db.KeyValue.Delete("test") == 1); Assert.IsTrue(db.KeyValue.Get("test") == null); Assert.IsTrue(db.KeyValue.Count() == 0); } }
private IEnumerable <TrustModel> LoadSQLite(FileInfo info) { using (var db = TrustchainDatabase.Open(info.FullName)) { var trusts = db.Trust.Select(); foreach (var trust in trusts) { trust.Issuer.Subjects = db.Subject.Select(trust.TrustId).ToArray(); } return(trusts); } }