在mvc 4

时间:2016-01-08 11:51:26

标签: c# asp.net-mvc entity-framework

我在简单的mvc应用程序中创建模型。创建模型类文件后,我在解决方案中添加控制器。但是我无法添加它。

1这是模型类文件

namespace MvcApplication1.Models
{
    public class student
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int Salary { get; set; }
    }
    public class studentDbcontext : DbContext
    {
        public DbSet<student> students { get; set; }
    }
}

2还web.config

<connectionStrings>
<add name="DefaultConnection" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=Test;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.SqlClient" />
<add name="studentDbcontext" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=Test;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.SqlClient" />

我面临的3个错误...... error i am facing...

0 个答案:

没有答案