Adding and updating entities with Entity Framework
In my last project I have used Entity Framework 5 Code First. I completed my project but had a lot of pain during the development process. I tried to explain my pain below: I had several data classes in my data access logic layer like Product, ProductCategory, Order, Company, Manufacturer etc... Each class has some references to some other classes. For example, a Product instance has a ProductCategory property. Inside Add and Update methods of my Data Access Object classes I set the states of each property (other than the primitive types) to Unchanged or Modified in the context. Below is some