Extending Entity Classes with Partial Methods

One of the problems early adopting LINQ developers complained of was their inability to know what is happening inside an entity class. During the incubation period of LINQ, there was no way for a developer to know, programmatically speaking, when an entity class object's property is being changed or when the entity class itself is being created except by modifying the generated entity class code, which we all know is a no-no. Any modifications to the generated entity class code will be lost the next time that code needs to be regenerated, so that just isn't feasible. Fortunately, the engineers at Microsoft were listening.

In Chapter 2, I told you about partial methods, and this is where partial methods ...

Get Pro LINQ: Language Integrated Query in C# 2008 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.