Take the 2-minute tour ×

I am trying to model this in code first EF. A competition can be specific to a country (e.g. Local League, which means a continent as well), a continent only (e.g. European Cup), or neither (e.g. World Cup)

I have a class for competition, country and continent. A one-to-many relationship exists between country and continent. How do i model the competition? This doesnt seem correct

public class Competition{
 public int CompetitionID { get; set; }
 public int Name { get; set; }
 public virtual ICollection<Season> Seasons { get; set; }
 public Country? Country { get; set; }
 public Continent? Continent { get; set;}
share|improve this question

1 Answer 1

There is a many-to-many relationship between Competitions and Countries/Continents so your Competition class should have a property called zoneID (which can be either Country or continent)

share|improve this answer

Your Answer


