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; context.Refresh(RefreshMode.StoreWins, entity); You can use it right after obtaining
Tag: entity framework
Not obvious issues in configuration of EF Code FirstNot 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
Error: DbArithmeticExpression arguments must have a numeric common type.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 typesError: 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.