Entity Framework 4 is nice, but has very confusing error messages.
Maybe it is just me, but getting a feel for what each error message means, and how to cure the underlying mistake(s) is time consuming.
For instance, it took me quite a while to find out why this error occurred during a project build:
Error 3004: Problem in mapping fragments starting at line 569: No mapping specified for properties MyEntity.MyValue in Set MyEntities. An Entity with Key (PK) will not round-trip when: Entity is type [MyEntities.MyEntity]
The solution was simple, I had forgotten to manually perform the “Generate Database from Model…” step before building my solution and was glad I found it in this Stack Overflow answer:
Have since discovered that after I add/change/delete properties on my entities I must “Generate Database from Model” before I compile otherwise I get 3004 mapping errors.
Note that this generation is always a manual step; I haven’t found a way to automate that (if you have found a way: please add a comment below).
–jeroen
via: .net – Entity Framework 4 mapping fragment error when adding new entity scalar – Stack Overflow.
Like this:
Like Loading...