I have mapped existing database in EF Core and got model classes associated with the tables.
For example: Employee
class
public int EmployeeId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public ICollection<EmployeeTeams> EmployeeTeams { get; set; }// all the teams employee is in
Teams
class:
public int TeamId { get; set; }
public string TeamName { get; set; }
public int? TeamLeaderId { get; set; }
public Employees TeamLeader { get; set; }
public ICollection<EmployeeTeams> EmployeeTeams { get; set; }
EmployeeTeams
class:
public int EmployeeId { get; set; }
public int TeamId { get; set; }
public Employees Employee { get; set; }
public Teams Team { get; set; }
My question is: does EmployeeTeams
auto update when I add to EmployeeTeams
table (it has foreign keys to Employee
and Teams
table)?