If you notice that the context returns the same entity even if it is already changed one line before, you probably what the following
ObjectContext context = ((IObjectContextAdapter)this.Context).ObjectContext;
You can use it right after obtaining an entity with a statement like follows:
var order = this.Context.Order.Single(e => e.ID == id);
This post describes my own issues which I bumped into while setting up EF Code First. This is not a complete list of all possible issues and any input would be appreciated. Connection String In web project it may be not obvious why is database not created. The error message may tell about the null reference […]
From time to time you need to filter data by difference between two dates. For instance, you wanna take a difference between date from a record and Today.
You may get this error if you have entities related to itself. For example, you have a tree hierarchy.