Raysefo

Raysefo

  • 1.5k
  • 284
  • 150.2k

Suggestions to add a new property to an existing model - EF

Oct 26 2021 12:19 PM

I have an ASP.NET Web API which is already running for quite some time on production. I need to quickly add some fields to an existing model/table on my production. Sometimes it is tedious dealing with EF migrations. So adding this additional property to the model and manually altering the database table seems OK for me. That's why I am trying to figure it out using

Database.SetInitializer<GameContext>(null);

is it a good practice to add this line of code (in global.asax) to production? Any suggestions would be great.

Thank you.


Answers (2)