2012-07-15 50 views
0

我想在代码第一个EF中对此进行建模。一个国家的比赛可以是特定的(例如当地联盟,也就是一个大洲),一个大洲(例如欧洲杯)或两者都不是(例如世界杯)代码优先建模关系

我有一个竞赛类,国家级大陆。国家与大陆之间存在一对多关系。我如何模拟比赛?这似乎不正确

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;} 
} 

回答

0

有一个多到很多比赛和国家之间的关系/大洲所以你的竞争类应该有一个叫做财产了zoneid(它可以是国家或大陆)