小编use*_*668的帖子

ASP.NET MVC /实体框架错误 - 无效的列名称'Environment_Id'

我是ASP.NET MVC和EF的新手,希望这不是一个愚蠢的问题

当我传递模型来查看我收到此错误 - 异常详细信息:System.Data.SqlClient.SqlException:无效的列名称'Environment_Id'.

模型或数据库表具有该名称的属性.可以指导我吗?

  **Here is the Version Model Class**

  public partial class Version
  {
    public Version()
    {
        this.ProfileVersions = new List<ProfileVersion>();
        this.ServerInfoes = new List<ServerInfo>();
    }

    public int Id { get; set; }
    public string Number { get; set; }
    public string Tag { get; set; }
    public string Owner { get; set; }
    public string Approver { get; set; }
    public string Description { get; set; }
    public virtual ICollection<ProfileVersion> ProfileVersions { get; set; }
    public …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc entity-framework entity-framework-4 asp.net-mvc-4

7
推荐指数
1
解决办法
3万
查看次数