O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required