Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.