I know how to make source data using the migration API in EF 4.3. I play with this all night. However, my ultimate goal is to bring my project to the point where the user can pull it out of the control source and press F5, and they are good for searching, database, seed data, etc.
Currently, the first code does an excellent job of creating a database on a new build, but the seed data is not inserted until I update the database in the package manager console. At this point, he starts the seed method and inserts my seed data.
- Is it possible to just do this in the OnModelCreating method?
- Can I use the AddOrUpdate extension method here?
- Will this seed data be executed every time I press F5? If so, can I determine if the database has already been created or not, and only add this source data when creating the initial database?
source share