学海无涯

导航

2024年5月6日 #

EFCore 一对多 实体关系

摘要: 一、一对多关系 当单个实体与任意数量的其他实体关联时,将使用一对多关系。 必需的一对多 //主体实体 Principal (parent) public class Blog {//博客,一个博客有多个帖子 public int Id { get; set; } public ICollection 阅读全文

posted @ 2024-05-06 17:22 宁静致远. 阅读(30) 评论(0) 推荐(0) 编辑

EFCore 迁移异常解决方案

摘要: 添加迁移时显示错误: Both relationships between 'WorkCenter.Factory' and 'Factory' and between 'WorkCenter' and 'Factory.WorkCenters' could use {'FactoryId'} as 阅读全文

posted @ 2024-05-06 11:33 宁静致远. 阅读(24) 评论(0) 推荐(0) 编辑