您好我有一个MVC问题甚至阅读提示后作出的控制器。 加上对的DbContext构造,删除非工作过,改变的providerName =“System.Data.SqlClient的”等等。
我的模型类是这样的:
public class RecruiterModel
{
public string CompanyName { get; set; }
public string Website { get; set; }
public string CompanySize { get; set; }
public string LinkedInCompanyURL { get; set; }
public string LinkedInID { get; set; }
public string Specialities { get; set; }
public string Category { get; set; }
public string Location { get; set; }
public int ContactPhone { get; set; }
public string ContactEmail { get; set; }
}
public class RecruiterDBContext : DbContext
{
public DbSet<RecruiterModel> Recruiters { get; set; }
}
和我的web.config的ConnectionStrings看起来是这样的:
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="RecruiterDBContext"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Recruiters.mdf;Integrated Security=True"
providerName="System.Data.SqlClient"
/>
有小费吗?