Reputation: 4929
Is it generally a good idea to manually modify the generated EDMX file when working on a .NET project? I had a project once where the developers were modifying the edmx file manually, and it was accepted as a rule to never regenerate the whole EDMX file. For example, one change we made was with some fields whereby we changed them to enum values.
Then I was hired on a project where the developers were telling me to regenerate the EDMX file whenever I made database changes. This was a totally different point of view.
So what is the better solution? Has anyone had any nightmares where one was better than the other.
Upvotes: 1
Views: 304
Reputation: 8782
A general rule is not to edit any auto generated file whether it's EDMX or WinForms designer. However, if there is absolutely no other way and you do need to edit auto-generated class, then do it by using partial
class. This way your change won't get lost after the class is regenerated.
Upvotes: 2