底层连接已关闭:连接已与Entity Framework意外关闭

时间:2012-05-14 11:11:57

标签: wcf entity-framework poco

我有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 =&gt; s.Courses).ToList();

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

有人能帮帮我吗?

0 个答案:

没有答案