Using EF 4.0 i’m trying to do what i think should be dead simple but it seems to be generating broken code.
- Create a new project (class library)
- add a new EF model and generate from a db (doesn’t matter what)
- Compile (all good)
- add a 2nd EF model and generate from a db (again, doesn’t matter what)
- Compile (breaks)
Can you only have a single EF model per assembly or something?
I’m not aware of any limitation … although it seems to put code in that breaks everything as soon as you add a second model.
Any ideas?
EDIT:
Ok i got round the problem by adding each EF model to a sub folder this generates the duplicate code still but puts it in a separate namespace … u’d think it would be smart enough to figure out the duplication … oh well.
I never did completely get to the bottom of this but I figured out a work around which was to basically delete the project file and recreate it.
Odd that it would affect EF like this though??