Red*_*Red 3 .net sql-server entity-framework scaffolding hierarchyid
我正在试验 .net 核心、实体框架和 sqlserver,我认为hierarchyID 是我想要建模的完美数据类型。但是当我搭建数据库时,EFC 无法映射层次结构。
Could not find type mapping for column 'dbo.ingredient.hierarchy_id' with data type 'hierarchyid'. Skipping column.
Could not scaffold the primary key for 'dbo.ingredient'. The following columns in the primary key could not be scaffolded: hierarchy_id.
Unable to generate entity type for table 'dbo.ingredient'.
Could not find type mapping for column 'dbo.ingredient_location.ingredient_id' with data type 'hierarchyid'. Skipping column.
Could not find type mapping for column 'dbo.locations.location' with data type 'geography'. Skipping column.
Could not find type mapping for column 'dbo.pantry_ingredient.ingredient_id' with data type 'hierarchyid'. Skipping column.
Run Code Online (Sandbox Code Playgroud)
我应该放弃使用该数据类型的想法还是有解决方法?
我寻找了一些解决方案,但所有解决方案都需要手工编写脚手架,而我目前没有足够的信心这样做
小智 8
我有同样的问题。我的项目使用了所有 Microsoft 库版本 3.1.4 和 MySQL.Data 版本 8.0.22 和 MySQL.Data.EntityFrameworkCore 版本 8.0.22 幸运的是我之前有一个非常相似的项目构建,它使用了 Microsoft 库版本 3.1.4 和 MySQL.Data版本 8.0.20 和 MySQL.Data.EntityFrameworkCore 版本 8.0.20 一旦我将 MySQL 库切换回版本 8.0.20 脚手架工作得很好。
我想只是冲突的库或版本 8.0.22 有一些错误。
| 归档时间: |
|
| 查看次数: |
2686 次 |
| 最近记录: |