1

我有 2 个 POCO 课程:

public class Student
{
    public int StudentId { get; set; }
    public string StudentName { get; set; }
    public virtual ICollection<Course> Courses { get; set; }
}

public class Course
{
    public int CourseId { get; set; }
    public string CourseName { get; set; }
    public virtual Student { get; set; }
}

我还为我的 DbContext 设置了以下设置:

Configuration.LazyLoadingEnabled = false;
Configuration.ProxyCreationEnabled = false;

我使用 WCF 项目拉出: myContext.Students.Include(s => s.Courses).ToList();

在 Web 服务客户端我得到底层连接已关闭:连接意外关闭。错误

有人可以帮我吗?

4

0 回答 0