有了RavenDb
它真的是小菜一碟:
public class DataAccessModule : NinjectModule {
public override void Load() {
Bind<IDocumentStore>().ToMethod(
context => {
var documentStore = new EmbeddableDocumentStore {
DataDirectory = @"~/App_Data/database",
UseEmbeddedHttpServer = true
};
return documentStore.Initialize();
}
).InSingletonScope();
Bind<IDocumentSession>().ToMethod(context =>
context.Kernel.Get<IDocumentStore>().OpenSession()
).InRequestScope();
}
}
如何管理依赖注入Couchbase .NET client
?