我读到了
on this tutorial
RavenDB可用于存储类的实例(例如
Menu
他们使用的对象)。我试着复制他们的例子,但使用了一个更简单的例子,用C#:
using Raven.Client.Document;
using Raven.Client;
namespace Project3
{
class MainClass
{
public static void Main()
{
IDocumentStore docStore = new DocumentStore()
{
Url = "http://localhost:8080",
DefaultDatabase = "Northwind"
};
docStore.Initialize();
var session = docStore.OpenSession();
StringHolder strHolder = new StringHolder();
session.Store(strHolder);
session.SaveChanges();
}
}
class StringHolder
{
string name = "kj";
}
}
然而,当我运行该程序并检查数据库时,我看到的日志如下:
所以
StringHolder
参数
name
未存储。为什么会出现这种情况?在教程中
菜单
和
Allergenics
导致类变量存储在结果文档中?