标签:io ar sp on bs as ui nbsp text
Area类
public virtual User User { get; set; }
User类
public virtual Area Area { get; set; }
Context类
modelBuilder.Entity<Area>() //巡检区域-区域负责人
.HasOptional(a => a.User)
.WithOptionalDependent()
.Map(x => x.MapKey("UserID"));
modelBuilder.Entity<User>() //巡检区域-区域负责人
.HasOptional(u => u.Area)
.WithOptionalDependent()
.Map(x => x.MapKey("AreaID"));
标签:io ar sp on bs as ui nbsp text
原文地址:http://www.cnblogs.com/xihong2014/p/4074229.html