code first - MS Entity Framework 4.1 - Maintain data across restructuring -


i using code first approach manage ef. examples have seen don't seem allow use ef able make changes db schema , preserve data.

so have entity/object of:

public class person    int id;    string nickname; 

and add age so:

public class person    int id;    string nickname;     int age; 

how can preserve data may in database "person"?

dont call system.data.entity.database.setinitializer().

or call system.data.entity.database.setinitializer() createdatabaseifnotexists().

calling dropcreatedatabasealways or dropcreatedatabaseifmodelchanges drop db.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -