Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created August 28, 2015 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/e5e1e1b164aaf8eadc8e to your computer and use it in GitHub Desktop.
Save debugmodedotnet/e5e1e1b164aaf8eadc8e to your computer and use it in GitHub Desktop.
static void CreateStudent()
{
Student s = new Student
{
Id = 1,
Age = 12,
Name = "Foo"
};
StudentAccount sa = new StudentAccount
{
Amount = 300,
Name = "Sports Account",
Student = s
};
Context c = new Context();
c.Students.Add(s);
c.StudentAccounts.Add(sa);
c.SaveChanges();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment