2015-12-02 35 views
0

對於企業庫6日誌記錄,我們需要在Startup.cs的Web應用程序中添加下面提到的行,那麼只有我們可以使用數據庫日誌記錄。如何爲使用企業庫的WCF服務應用程序使用數據庫日誌記錄6

DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory()); 

同樣的方式,我應該在哪裏添加上述行WCF服務應用程序使用的數據庫日誌???

+0

在* .svc.cs文件? – Tim

回答

1

我們需要添加Global.asax內部WCF服務應用程序,然後使用以下提到的代碼

protected void Application_Start(object sender, EventArgs e) 
{ 
    DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory()); 
} 

那麼一切都將很好地工作......享受

相關問題