This question is locked. New answers and comments are not allowed.
I have an Entity Framework (Code First, 4.1) context that is used in a WCF service layer. If I have the service set up this way:
The service works fine. If I set it up like this, following the examples for grid binding via web services...
It consistently get the exception:
This is a serialization issue. For whatever reason the ToGridModel extension method isn't working properly with EFCF 4.1. What can be done to fix this?
public IEnumerable<Dto.PlanMember> GetPlanMembers() { var planMembers = from member in this.DataSource.PlanMemberDbSet.Take(10) select new Dto.PlanMember { Id = member.Id, FirstName = member.FirstName, LastName = member.LastName }; return planMembers;}The service works fine. If I set it up like this, following the examples for grid binding via web services...
public GridModel GetPlanMembers(GridState state) { var planMembers = from member in this.DataSource.PlanMemberDbSet.Take(10) select new Dto.PlanMember { Id = member.Id, FirstName = member.FirstName, LastName = member.LastName }; return planMembers.ToGridModel(state);}It consistently get the exception:
The underlying connection was closed: The connection was closed unexpectedly.
This is a serialization issue. For whatever reason the ToGridModel extension method isn't working properly with EFCF 4.1. What can be done to fix this?