I am working with an existing EDMX model where I had to add a new column to DB. I have updated the model from DB and now I can see the new column in the model. However, I have to update the Classes with the newly added column and add get; set; methods etc,. Is there an automate way to update this via Visual Studio but still retain the existing code and add the new property in? This is the first time I’m using EDF an find it hard to get my head around it.
Many thanks in advance
Did you use the ADO.NET DbContext Generator to create model classes for you? That’s how I do it. If you do that then, generally speaking, those classes will recreate correctly if you add a new column to a corresponding DB table. Any code related to some generated I put in a separate viewmodel or other custom-built model that isn’t subject to being overwritten when those are regenerated. Then there’s just some minor mods to my viewmodels if the DB changes.