33 lines
897 B
C#
33 lines
897 B
C#
using System.Collections.ObjectModel;
|
|
|
|
namespace CodeFirstExistingDatabase.Migrations
|
|
{
|
|
using System;
|
|
using System.Data.Entity;
|
|
using System.Data.Entity.Migrations;
|
|
using System.Linq;
|
|
|
|
internal sealed class Configuration : DbMigrationsConfiguration<CodeFirstExistingDatabase.PlutoContext>
|
|
{
|
|
public Configuration()
|
|
{
|
|
AutomaticMigrationsEnabled = false;
|
|
}
|
|
|
|
protected override void Seed(CodeFirstExistingDatabase.PlutoContext context)
|
|
{
|
|
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"}
|
|
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|
|
}
|