Code-first migration: How to set default value for new property?
问题 I am using EF6 for storing instances of the report class in my database. The database already contains data. Say I wanted to add a property to report , public class report { // ... some previous properties // ... new property: public string newProperty{ get; set; } } Now if I go to the package-manager console and execute add-migration Report-added-newProperty update-database I will get a file in the '/Migrations' folder adding a newProperty column to the table. This works fine. However, on