6 .net c# database persistence dictionary
我正在基于ESENT数据库引擎(使用ManagedEsent互操作层)实现通用的,持久的.NET集合.到目前为止,我一直专注于完全模仿他们的System.Collections.Generic对应的类,除了他们在构造函数中采用指示数据库应该去的位置的路径.像这样的代码工作:
using Microsoft.Isam.Esent.Collections.Generic;
static void Main(string[] args)
{
var dictionary = new PersistentDictionary<string, string>("Names");
Console.WriteLine("What is your first name?");
string firstName = Console.ReadLine();
if (dictionary.ContainsKey(firstName))
{
Console.WriteLine("Welcome back {0} {1}", firstName, dictionary[firstName]);
}
else
{
Console.WriteLine("I don't know you, {0}. What is your last name?", firstName);
dictionary[firstName] = Console.ReadLine();
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是:
我将在下周准备第一个版本,但我想确保我正在构建正确的东西.
小智 5
我已经在 Codeplex 上发布了 PersistentDictionary。这仅支持序列化结构,但我将研究支持存储和检索任意对象的不同数据结构。
https://github.com/microsoft/managedesent
| 归档时间: |
|
| 查看次数: |
1974 次 |
| 最近记录: |