I’m using the Entity Framework 4 to serialize an object via an XML web service. The scalar properties on the object serialize fine, and I have a 0 or 1 property which also serializes.
I have one property however which is omitted from the output. It’s a one to many (My object has a List), but the Sections navigation property isn’t even included in the output. I’m including the property in my linq query, and debugging shows that the items in the Sections property are indeed loading, just not serializing. Here’s my code:
dim item = Db.Surveys.Include("SurveySections").FirstOrDefault(Function(u) u.SurveyID = surveyId)
I got around this by creating an additional property which acted like an extra getter/setter for the EF property.