-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Milestone
Description
Hello,
With EF7 all child entities are get only collections.
If I use the generated entities for deserialization, the child entities remain null.
Example of an entity with a child collection. Before EF7 it was get & set.
public partial class ComplaintType
{
...
[InverseProperty("ComplaintType")]
public virtual ICollection<LocalizedComplaintType> LocalizedComplaintTypes { get; } = new List<LocalizedComplaintType>();
}
When I try to deserialize the returned json to the ComplaintType object, the LocalizedComplaintTypes property is null
return await httpClient.GetFromJsonAsync<IEnumerable<ComplaintType>>(...);
If I modify the ComplaintType class putting set or init on LocalizedComplaintTypes property, it works.
Why this change in EF7? I had a lot of drawbacks... and not limited to this.
What is the workaround?