Skip to content

Instantly share code, notes, and snippets.

@rafaelpadovezi
Created March 12, 2021 20:35
Show Gist options
  • Save rafaelpadovezi/a5e79e1e4ffbe3ff8406c9998f6e4d21 to your computer and use it in GitHub Desktop.
Save rafaelpadovezi/a5e79e1e4ffbe3ff8406c9998f6e4d21 to your computer and use it in GitHub Desktop.
Adding entities
var employee = new Employee
{
Name = "John Doe",
Entries = new List<TimeEntry>
{
new TimeEntry
{
Start = TimeSpan.FromHours(8),
End = TimeSpan.FromHours(12)
}
}
};
context.Add(employee);
context.SaveChanges();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment