Reputation: 3101
I have an asp.net web Application. I have added Entity Data Model
in the App_Code
folder, that generates the following files :
Model.Context.tt
Model.edmx
Model.tt
In Model.tt
there is Model.cs
file, that contains Partial classes of selected tables.
Now when I try to update the .edmx
file to add a new table, Model.cs
is not getting updated, it does not add the new class for newly added table.
How to update Model.cs
file when any new table or update existing table in Model.edmx
?
Thanks
Upvotes: 0
Views: 351
Reputation: 11717
This issue generally appears when our .edmx
file is present in a folder in the project. Generally I was able to solve the issue by right clicking the .edmx
file and then selecting Run Custom Tool
option. In some cases you will need to do the same for Context.tt
and .tt
file also.
In few weird cases when I tried adding/editing columns of an existing table, to update the entity file, I had to open the .cs
file inside the .tt
file and then the run Run Custom Tool
on .tt
file. It almost worked every time I edited an existing table and entity files were updated successfully.
Hope it helps.
Upvotes: 1