Several changes before queryDatabase project
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace CodeFirstExistingDatabase.Migrations
|
||||
{
|
||||
using System;
|
||||
@ -14,10 +16,17 @@ namespace CodeFirstExistingDatabase.Migrations
|
||||
|
||||
protected override void Seed(CodeFirstExistingDatabase.PlutoContext context)
|
||||
{
|
||||
// This method will be called after migrating to the latest version.
|
||||
context.Authors.AddOrUpdate(a => a.Name,
|
||||
new Author
|
||||
{
|
||||
Name = "Author 7",
|
||||
Courses = new Collection<Course>()
|
||||
{
|
||||
new Course(){ Name = "Course for Author 7", Description = "Description 7"}
|
||||
|
||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||
// to avoid creating duplicate seed data.
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user