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

jQuery Ajax Render Fragments OR Whole Page -

javascript - Iterate over array and calculate average values of array-parts -

java - Simple Command Line calculator -