Creating change proxies
As I’ve said, the POCO entity classes that you create when you use the DbContext API don’t use proxy tracking unless they comply with some strict rules. Here they are:
In order for the DbContext
to generate change-tracking proxies from your classes, the following must be true:
• The class must be public.
• The class must not be sealed (NotInheritable
in Visual Basic).
• The class must not be abstract (MustInherit
in Visual Basic).
• The class must have a default (parameterless) constructor.
• The default constructor must be public or protected.
• Each property of the class must have public and virtual (Overridable
in Visual Basic) get
and set
accessors.
• Collection navigation properties (the many-side) must be declared ...
Get Fluent Entity Framework now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.