ASP.NET MVC 如何查询其他数据库里的表

我要查询的表
我写的Model
public class DEPARTMENT
{
public int ID { get; set; }
public string NAME { get; set; }
public string TYPE { get; set; }
public string DESCRIPTION { get; set; }
public int CLASS { get; set; }
public int SUBCLS { get; set; }
public int EMP_COUNT { get; set; }
public int DEPTCLOSE { get; set; }
public int DISPORDER { get; set; }
public string SITE { get; set; }
public int Account_Id { get; set; }
}

    public class MyOAContext: DbContext
{
    public MyOAContext() : base("MyOa")
    {
    }
    public DbSet<DEPARTMENT> DP { get; set; }
}

![图片说明](https://img-ask.csdn.net/upload/201605/23/1463985975_849667.png)

是不是这里的model接收不了查询到的数据

你用的是codefirst还是dbfirst,前者你定义的model有问题,而且数据库应该让它自己生成。后者你不需要定义model,model应该让ef去生成。