项目场景:

ABP项目执行数据库迁移


问题描述:

Unable to determine the relationship represented by navigation 'XXX' of type 'XXX'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.


原因分析:

在XXXDbContext中OnModelCreating 下缺少对初始化的配置。


解决方案:

/// <summary>
/// Fluent API
/// </summary>
public class UserEntityConfig : IEntityTypeConfiguration<User>
{public void Configure(EntityTypeBuilder<User> builder){// ......}
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{base.OnModelCreating(modelBuilder);//继承自IEntityTypeConfiguration<>的各实体 Fluent APImodelBuilder.ApplyConfigurationsFromAssembly(typeof(XXXCoreModule).Assembly);
}

Unable to determine the relationship represented by navigation ‘XXX‘ of type ‘XXX‘.相关推荐

  1. Unable to determine if the owner (Domain\UserName) of job JOB_NAME has server access

    早上巡检的的时候,发现一数据库的作业报如下错误(作业名等敏感信息已经替换),该作业的OWNER为一个域账号: JOB RUN: 'JOB_NAME' was run on 2016-6-1 at 7: ...

  2. Go微服务报错protoc-gen-go: unable to determine Go import path for

    问题 $ protoc --go_out=./ hello.proto protoc-gen-go: unable to determine Go import path for "hell ...

  3. 创建Hbase Hive外部表报错: Unable to determine ZooKeeper ensemble

    创建HBase的Hive外部表 1: create external table ttt(rowkey string,info map<string,string>)STORED BY ' ...

  4. Oracle错误:ORA-27121: unable to determine size of shared memory segment

    为什么80%的码农都做不了架构师?>>>    今天在用SQLPLUS登陆数据库时,忽然报了一个错误,错误的代码如下: ORA-01034: ORACLE not available ...

  5. 遇到:ORA-27121: UNABLE TO DETERMINE SIZE OF SHAR...

    2019独角兽企业重金招聘Python工程师标准>>> ORA-01034: ORACLE not available ORA-27121: unable to determine ...

  6. 连接Janusgraph时报Unable to determine Elasticsearch server version. Default to FIVE.异常

    连接Janusgraph时报Unable to determine Elasticsearch server version. Default to FIVE.异常 采用的 janusgraph + ...

  7. 解决Unable to determine application id: com.android.tools.idea.run.ApkProvisionException:

    最近Android Studio更新了3.6.1版本.我本着更新肯定比不更新好的原则,就选择更新了. 没想到遇到了一个奇怪的问题:Unable to determine application id: ...

  8. Android studio运行出现Unable to determine application id: com.android.tools.idea.run.ApkProvisionExcepti

    Android studio运行出现Unable to determine application id: com.android.tools.idea.run.ApkProvisionExcepti ...

  9. 解决 Unable to determine application id: com.android.tools.idea.run.ApkProvisionException

    问题:Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: Error loadi ...

最新文章

  1. html %3c% page,page.html
  2. 软件测试之Selenium IDE
  3. linux shell字符串及字符串长度获取方式
  4. 008 RestFul API 拦截器
  5. python3创建一个游戏窗口
  6. java任何表达式都可以当作语句_在Java语言中语句用分号终止,并不是所有的表达式都可以构成语句...
  7. Teams App设备的地理位置能力
  8. ASP.NET Core 源码学习之 Options[1]:Configure
  9. JavaScript DOM编程艺术第一章:JavaScript简史
  10. android 向下动画,使用向上/向下滑动动画显示和隐藏视图
  11. 数学建模论文写作模板
  12. Python关键字keyword
  13. 理解flask中的蓝图
  14. python snap7 简书_第14篇-Python中的Elasticsearch入门
  15. 2022 Java 企业面试题汇总
  16. 74HC148引脚图及功能
  17. 拥有奇瑞QQ冰淇淋·桃欢喜才懂的幸福
  18. 720度全景带你vr云游景区,vr云游感受和应用介绍
  19. C语言之struct
  20. 产品经理(助理)任职要求

热门文章

  1. nodejs实现公众号服务URL绑定验证,nodejs实现公众号关注并回发送一条消息,以及关注之后的聊天自动回复消息
  2. Nvidia Agx Xavier平台10Gb PCIE网卡速度限制为1Gb问题调试记录
  3. 什么是刀片式服务器?
  4. 比较工具导出html比较结果,使用Beyond Compare如何生成文件比较报告
  5. excel职称计算机应用,2017职称计算机考试Excel辅导:工作表的编辑
  6. C#在扩展桌面播放PPT并且无任务栏按钮
  7. mybatis-Plus自动生成代码
  8. Zookeeper详解(五):通过JMX查看Zookeeper信息
  9. 无线华为能连苹果不能连接到服务器,华为手机连苹果Mac,连不上?手把手教你...
  10. BottomBarLayout——方便快捷地实现底部导航栏