簡體   English   中英

使用ravenDB的成員資格提供程序

[英]membership provider using ravenDB

我正在嘗試實現使用ravenDB的.net成員資格提供程序。 我已經在我的mvc4應用程序中設置了raven db,我認為我可以正確設置要使用ravenDB的成員資格提供程序,除非從成員資格提供程序調用文檔存儲。 我發現的示例使用以下

 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; }
        }

由於我已經在global.asax文件中的mvc項目中設置了文檔存儲

public static IDocumentStore DocumentStore { get; private set; }
        private static void CreateRavenDBDocumentStore()
        {
            DocumentStore = new DocumentStore
            {
                ConnectionStringName = "RavenDB"
            }.Initialize();
        }

Application_Start(){
    CreateRavenDBDocumentStore();
    ...
}

是否可以使用我global.asax.cs文件中的此代碼段創建將使用MembershipProvider調用的文檔存儲?

希望我不要太困惑:)

謝謝

這是一個很好的項目,並編寫了將ravendb成員資格提供程序與mvc結合使用的內容。您可以參考我在本案例中使用的該項目

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM