Several times, sample data is important, but boring to generate due to many related tables. So, in the Entity Framework Code, at first I think this is an elegant way to insert them into DropCreateDatabaseIfModelChanges :: Seed ().
But is there a way to export existing data from the database back to the row as C # / VB sentences that insert poco objects?
If this works, we can use it to back up data gracefully or save it in several scripted scenarios, switch them as needed to improve our test, etc.
EXPORT DATABASES AS NEXT CODE:
var students = new List<Student> { new Student { FirstMidName = "Carson", LastName = "Alexander", }, new Student { FirstMidName = "Meredith", LastName = "Alonso", }, new Student { FirstMidName = "Arturo", LastName = "Anand", },
database export entity-framework code-first
victorwoo
source share