本文整理汇总了C#中IDatabase.Init方法的典型用法代码示例。如果您正苦于以下问题:C# IDatabase.Init方法的具体用法?C# IDatabase.Init怎么用?C# IDatabase.Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDatabase
的用法示例。
在下文中一共展示了IDatabase.Init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FavoritesRepoCheck
public void FavoritesRepoCheck()
{
CleanUpDatabase();
_db = CreateDBInstance();
_db.Init();
var record = new FavoritesStreamReference()
{
TableName = "folder_refs",
id = new Identifier(1)
};
var repo = FavoritesRepository.Create(_db);
var recordKey = repo.CreateKey();
recordKey["id"] = record.id;
recordKey["TableName"] = record.TableName;
var found = repo.FindByKey(recordKey);
Assert.IsTrue(found.Equals(default(FavoritesStreamReference)));
repo.Write(record);
found = repo.FindByKey(recordKey);
Assert.IsTrue(found.Equals(record));
repo.Remove(recordKey);
found = repo.FindByKey(recordKey);
Assert.IsTrue(found.Equals(default(FavoritesStreamReference)));
CleanUpDatabase();
}
示例2: DatabaseCreated
public void DatabaseCreated()
{
CleanUpDatabase();
_db = CreateDBInstance();
_db.Init();
Assert.IsTrue(System.IO.File.Exists(_dbPath));
CleanUpDatabase();
}
示例3: FileRepoCheck
public void FileRepoCheck()
{
CleanUpDatabase();
_db = CreateDBInstance();
_db.Init();
DatabaseService.RegisterInstance(_db);
var file = FileLink.Create(@"C:\dummy_test_file.txt");
DatabaseService.FileRepository.Write(file);
var dbObject = (IPersistable)file;
Assert.IsFalse(dbObject.Key.IsEmpty());
var readed = DatabaseService.FileRepository.FindByKey(dbObject.Key);
Assert.IsFalse(readed == default(FileLink));
Assert.IsTrue(readed.FullName == file.FullName);
DatabaseService.FileRepository.Remove(readed);
readed = DatabaseService.FileRepository.FindByKey(dbObject.Key);
Assert.IsTrue(readed == default(FileLink));
CleanUpDatabase();
}
示例4: FolderRefRepoCheck
public void FolderRefRepoCheck()
{
CleanUpDatabase();
_db = CreateDBInstance();
_db.Init();
DatabaseService.RegisterInstance(_db);
var folderRef = new FolderRefEntity();
folderRef.Path = @"C:\Users\";
DatabaseService.FolderRefRepository.Write(folderRef);
Assert.IsFalse(folderRef.Key.IsEmpty());
var readed = DatabaseService.FolderRefRepository.FindByKey(folderRef.Key);
Assert.AreEqual(folderRef.Key.Value, readed.Key.Value);
DatabaseService.FolderRefRepository.Remove(folderRef);
Assert.IsNull(DatabaseService.FolderRefRepository.FindByKey(folderRef.Key));
CleanUpDatabase();
}