0

I created an Entity Model and then used code generation to create DBContext classes. When I perform and TSQL update statement in SQL Server on one of my tables, do I have to update my model every time I perform an update when debugging? When I deploy my MVC app, will the model automatically update? Right now I am clicking Run Custom Tool on my Context.tt file. Also, do I get rid of the custom tool property on my former edmx file? Thank you

1 Answer 1

1

The entity framework model will not update automatically. If you make changes to columns or tables in the database, you'll need to refresh your model.

If you open the .edmx file and right-click in an empty space, there's an option to Update Model from Database which will find tables and columns that have changed. I think you'll have to run your T4 code generation again after updating the model (haven't used T4 myself, so I'm not sure).

Sign up to request clarification or add additional context in comments.

1 Comment

that is what I suspected. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.