I use an embedded database and wonder whether the only way to operate on data is withing the system database? I took a look in the management studio and saw that all my data is dumped into the system database. Even when I created a new database within management studio this new db remained untouched. Using a code approach I did not get much further because it seems that multi tenancy is not supported within embedded instances. So the only way is to store to and access data from the SYSTEM DATABASE?

Thanks

有帮助吗?

解决方案

That is correct. The embedded mode is designed to operate against a single database, which is also the system database. It does not currently support other "tenant" databases.

If you need a small number of different databases, you can create multiple embedded databases. Each would need their own EmbeddableDocumentStore instance, and a different path specified for the data directory.

If you are designing something that needs lots of databases, the embedded mode is not appropriate.

其他提示

If you give your document store a default database name your data will be stored in that database.

var documentStore = new EmbeddableDocumentStore
{
    DataDirectory = "Data",
    DefaultDatabase = "MyDb"
};
documentStore.Initialize();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top