Reputation: 931
I am able to create an ObjectContext for my model and it runs fine when I try to retrieve all the values from a database table. However, I would like to see the code generated by the EDM Designer and for this I change the Code Generation Strategy from None to Default.
Now when I try to compile the program I get a whole list of errors like...
The type 'Chapter2ConsoleApp.Address' already contains a definition for 'Street2'
What is the workaround?
Upvotes: 1
Views: 5200
Reputation: 61
Changing the Code generation strategy back to 'default' does not clean up the files generated when the EntityModelCodeGenerator was previously executed. You will have to manually delete the T4(.tt) files and their children from the project. Then right click on the .edmx file and select 'Run Custom Tool'. This will generate a new designer.cs file with the default configuration.
Upvotes: 6
Reputation: 109337
You can always see the generated code. You don't have to change code generation strategy. In the solution explorer, click the little arrows next to the tt files:
Upvotes: 0