为了账号安全,请及时绑定邮箱和手机立即绑定

如何在实体框架中创建多对多映射?

如何在实体框架中创建多对多映射?

C#
温温酱 2019-11-12 09:59:53
在这种情况下,我有2个实体,例如Contract,Media。public class Media : Entity{    public string Name {get; set;}    public bool Enabled    *//other properties can be ignored..*}public class Contract : Entity{    public string Code {get; set;}    *//other properties can be ignored..*}合同有许多媒体,看来它们是多对多的。但!!首先在EF代码,我需要在ContractMedia表(EF自动生成)中再添加3个字段。例如StartDate,EndDate和Price。无法将其添加到媒体实体中。在这种情况下如何映射?
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 294 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信