dwilli
3
Q:

one to many relationship ef core

// 1:M
// ONE company has MANY employees

public class Company
{
    public int Id { get; set; }
    public string Name { get; set; }
    public ICollection<Employee> Employees { get; set; }
}
public class Employee
{
    public int Id { get; set; }
    public string Name { get; set; }
    public Company Company { get; set; }
}
0

New to Communities?

Join the community