我有两个联结/桥接表,DailyLogEmployees和DailyLogVendors来处理多对多的关系:
public class DailyLog:ActiveEntity
{
public int Id {get;set;}
[ForeignKey("EmployeeId")]
public ICollection<Employee> Employees { get; set; }
[ForeignKey("VendorId")]
public ICollection<Vendor> Vendors { get; set; }
}
and defined in the model as such
modelBuilder.Entity<DailyLog>().HasMany(d => d.Employees).WithMany().Map(m =>
{ m.MapLeftKey("DailyLogId");
m.MapRightKey("EmployeeId");
m.ToTable("DailyLogEmployees");
});
modelBuilder.Entity<DailyLog>().HasMany(d => d.Vendors).WithMany().Map(m =>
{ m.MapLeftKey("DailyLogId");
m.MapRightKey("VendorId");
m.ToTable(
"DailyLogVendors");
});
项目在元数据中创建,但是当我实例化新的DailyLog时,员工或供应商都不存在。
Breeze是版本1.3.6 am我做了一些愚蠢的事情,我不希望在另一端有任何导航,员工或供应商只需在DailyLog上获得任何帮助或见解。