Reputation: 3515
I'm trying to implement .net membership provider which uses ravenDB. I already set raven db inside my mvc4 application and I think I'm setup correctly membership provider for use ravenDB except calling document store from membership provider. Example which I found uses following
public IDocumentStore DocumentStore
{
get
{
if (documentStore == null)
{
throw new NullReferenceException("The DocumentStore is not set. Please set the DocumentStore or make sure that the Common Service Locator can find the IDocumentStore and call Initialize on this provider.");
}
return this.documentStore;
}
set { this.documentStore = value; }
}
Since I'm already set document store in my mvc project inside global.asax file
public static IDocumentStore DocumentStore { get; private set; }
private static void CreateRavenDBDocumentStore()
{
DocumentStore = new DocumentStore
{
ConnectionStringName = "RavenDB"
}.Initialize();
}
inside
Application_Start(){
CreateRavenDBDocumentStore();
...
}
Is it possible to use this code snippet from my global.asax.cs file for creating document store which will use call from MembershipProvider?
Hope I was not too confused :)
Thanks
Upvotes: 0
Views: 137
Reputation: 739
Here is a good project and write up of using ravendb membership provider with mvc.You could refer this project which i used in my case.
Upvotes: 1