Entity Framework (4)


How To: Refresh POCO entity from DbContext

If you notice that the context returns the same entity even if it is already changed one line before, you probably what the following

You can use it right after obtaining an entity with a statement like follows:

 




Not obvious issues in configuration of EF Code First

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 […]




Error: DbArithmeticExpression arguments must have a numeric common type.

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.




Error: Unable to determine the principal end of an association between the types

You may get this error if you have entities related to itself. For example, you have a tree hierarchy.