This project is read-only.

Partial Class...?

May 2, 2011 at 8:16 AM

In Section 8, we add an Order class as public partial class Order, then we do it again in section 9 with ShoppingCart with literally no reference to it (I actually missed it the first time) or explanation as to why we do it or what it achieves.

Can someone explain this?

Thanks in advance,


May 11, 2011 at 10:11 PM

That used to be required before using Entity Framework Code First to allow placing annotations on the model. In the old version, the EF model was generated using the Database First designer, and we used a partial class so that the annotations wouldn't be overwritten if the model was regenerated.

That's no longer required with Code First, and the partials will be removed in the next update - Issue here: