For example, I have the following classes
class User
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Team> Teams { get; set; }
public ICollection<Address> Addresses { get; set; }
}
class Team
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<User> Users { get; set; }
}
class Address
{
public int Id { get; set; }
public string AddressType { get; set; }
public string Address { get; set; }
public int UserId { get; set; }
}
I have a way to determine at runtime if property is navigation property using ObjectContext metadata thanks to entity framework check if property is navigation property
But what I need additionally is to know if property is many-to-many (like Teams property in the example above) or one-to-many (like Addresses). Is there a way to do this?