Created
July 14, 2018 15:32
-
-
Save ssougnez/6865ebea66b16c587dcfd64b4ecc15f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jc = new Director | |
{ | |
FirstName = "James", | |
LastName = "Cameron" | |
}; | |
dbContext.Database.Insert(jc); | |
var avatar = new Movie | |
{ | |
DirectorId = jc.Id, | |
Title = "Avatar", | |
}; | |
dbContext.Database.Insert(avatar); | |
var sw = new Actor | |
{ | |
FirstName = "Sam", | |
LastName = "Worthington" | |
}; | |
var zs = new Actor | |
{ | |
FirstName = "Zoe", | |
LastName = "Saldana" | |
}; | |
dbContext.Database.Insert(sw); | |
dbContext.Database.Insert(zs); | |
dbContext.Database.Insert(new ActorMovie | |
{ | |
ActorId = sw.Id, | |
MovieId = avatar.Id | |
}); | |
dbContext.Database.Insert(new ActorMovie | |
{ | |
ActorId = zs.Id, | |
MovieId = avatar.Id | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment