0
此代碼編譯正常,但我的jQuery AJAX返回實體框架失敗實例的DbContext
錯誤:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
app.js:37 jqXHR =[object Object] textStatus = error errorThrown = Internal Server Error
語境:
public class IssuesServiceContext : DbContext
{
public IssuesServiceContext() : base("name=IssuesServiceContext")
{
this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
}
public DbSet<IssuesModel> IssuesModels { get; set; }
}
web.config
:
<connectionStrings>
<add name="IssuesServiceContext"
connectionString="Data Source=SQLDEV\ESG;Initial Catalog=ABC;User ID=abc;Password=password"
providerName="System.Data.SqlClient"/>
</connectionStrings>
硒ems在這條線上失敗
public IssuesServiceContext() : base("name=IssuesServiceContext")
貌似IssuesServiceContext的名字已經與您的類和構造與您的連接字符串的名稱相匹配,使部分就好了。嘗試一些「其他」調試,因爲它是服務器端而不是任何客戶端 –