.net的ef框架更新tidb6.5.3数据库实体模型报错(4.0.15版本没有问题)

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【概述】 场景 + 问题概述
.net的ef框架操作tidb6.5.3报错(4.0.15版本没有问题):

【应用框架及开发适配业务逻辑】
.net的ef框架

【问题】 当前遇到的问题
操作:使用.net的ef框架连接tidb6.5.3后,更新数据库实体模型
报错内容:无法生成模型:“System.ArgumentException: 元数据集合中已存在具有标识“Id”的项

【业务影响】
无法使用.net的ef框架

【TiDB 版本】
6.5.3报

Hello, 有更详细的日志可以参考吗?比如它实际执行了什么 SQL,或者 TiDB 返回了什么报错信息之类的。

报错的那块代码和报错详细信息发一下,还有用的是哪个数据库驱动

没有更详细的错误日志了 :joy:


这个是报错内容

请检查EF配置,确保与TiDB 6.5.3兼容。您可能需要更新或调整EF的一些配置选项,以适应新版本的TiDB。

你这个操作看起像从数据库生成edm模型吧,你把现有的model都删了重新同步试试

重新删除也不行,还专门搭了一个全新的tidb6.5.3的环境,全新生成模型,也不行 :sob:

请问哪些配置需要特别注意,是兼容tidb6.5.3的呢 :handshake:

看下报错的是哪个模型,show create table结果发一下

所有的表都报错,新建了一个非常简单的表,例如create table test(id int),这样的表都会报错。。。报元数据已经存在该表的错误,但实际上这个是新建的表,不可能存在。。。

这边在测试环境新建了4.0.15和6.5.3,然后打开审计日志,捕获sql后,发现原因所在:

select * from
(select 6 id from INFORMATION_SCHEMA.COLUMNS where table_schema = ‘test’) t
where t.id =1 ;

这个sql语句,在test库下面有表存在的情况下,在tidb4.0.15中,查询结果为空,这是正确的结果,但是在tidb6.5.3中,查询结果不为空,不是正确的结果

换成INFORMATION_SCHEMA.TABLES,就没有这个问题了。

查看了一下explain,上述sql,tidb6.5.3走的是MemTableScan:
image

但是在tidb4.0.15,或者换成INFORMATION_SCHEMA.TABLES表,执行计划走的是TableDual:
image

这个问题,会不会是一个bug?

根据这个错误信息,可能是数据表中已经存在一个名为“Id”的列,而 EF 框架又试图向元数据中添加一个同名的列,从而导致了冲突。

为了解决这个问题,您可以尝试以下几个步骤:

  1. 检查数据表结构:在 TiDB 数据库中检查相关数据表的结构,确认是否存在名为“Id”的列。如果不存在,则可以排除这个问题。如果存在,则需要进一步检查 EF 框架实体类中是否有同名的属性。
  2. 检查 EF 实体类:检查 EF 框架实体类中是否有名为“Id”的属性,如果有,则需要确认该属性是否与数据表中的“Id”列相对应。如果不对应,则需要更新实体类中的属性名称或者重新生成 EF 框架实体模型。
  3. 检查 EF 实体模型:如果 EF 框架实体类中没有名为“Id”的属性,或者与数据表中的“Id”列对应,那么需要检查 EF 实体模型中是否存在同名的元素。您可以通过打开 .edmx 文件,在“Model Browser”中查找名为“Id”的元素。如果存在,则需要将其删除,并重新生成 EF 框架实体模型。
  4. 检查 EF 实体模型生成代码:如果上述步骤都无法解决问题,则需要检查 EF 实体模型生成代码。您可以通过打开 .edmx 文件,右键单击空白处,选择“View Code”打开代码文件。在代码文件中搜索“Id”,查看是否存在重复定义的代码。如果存在,则需要删除重复定义的代码,并重新生成 EF 框架实体模型。

这个我查询结果我觉得和版本关系不大,根据SQL逻辑,影响查询结果的是字段在columns表的顺序,where t.id =1这个逻辑每太看懂为啥要这么查

select * from
(select 6 id from INFORMATION_SCHEMA.COLUMNS where table_schema = ‘test’) t
where t.id =1 ;

这句完全看不懂干啥的,你说有返回值返回的什么?理论上不应该有返回值

ef框架执行的不是这个sql,它执行了一个非常复杂的sql,这里只是将sql问题找出来,并极度简化,后面我把原始的sql贴出来。

这个极简sql的问题,并不是id字段名引起的,把sql改成
select * from
(select 6 c1 from INFORMATION_SCHEMA.COLUMNS where table_schema = ‘test’) t
where t.c1 =1 ;
也会出现相同的问题。

不同版本,这个sql执行结果不一样的,4.0.15执行结果是正确的,但是6.5.3是错误的。
这个是极简的问题sql,后面我把ef框架的原始sql贴出来。

ef框架原始sql很长很复杂,后面我把原始sql贴出来。

ef框架有问题的原始sql:

SELECT UnionAll1.C5 AS C1,
Extent1.Catalog,
Extent1.Schema,
Extent1.Name,
UnionAll1.Name AS C2,
UnionAll1.C1 AS C3,
UnionAll1.IsNullable AS C4,
UnionAll1.TypeName AS C5,
UnionAll1.C2 AS C6,
UnionAll1.C3 AS C7,
UnionAll1.DateTimePrecision AS C8,
UnionAll1.C4 AS C9,
UnionAll1.IsIdentity AS C10,
UnionAll1.IsStoreGenerated AS C11,
CASE
WHEN (Project5.C2 IS NOT NULL) THEN
(Project5.C2)
ELSE (0)
END AS C12
FROM
(SELECT /* Tables / CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME) AS Id, TABLE_CATALOG AS Catalog, TABLE_SCHEMA AS Schema, TABLE_NAME AS Name
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = ‘BASE TABLE’
AND TABLE_SCHEMA=schema() ) AS Extent1
INNER JOIN (
(SELECT Extent2.Id,
Extent2.Name,
Extent2.Ordinal AS C1,
Extent2.IsNullable,
Extent2.TypeName,
Extent2.MaxLength AS C2,
Extent2.Precision AS C3,
Extent2.DateTimePrecision,
Extent2.Scale AS C4,
Extent2.IsIdentity,
Extent2.IsStoreGenerated,
0 AS C5,
Extent2.ParentId
FROM
(SELECT /
Table columns / CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS CHAR)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS CHAR)
ELSE 0
END AS Precision,
DATETIME_PRECISION AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent2)
UNION
ALL
(SELECT Extent3.Id,
Extent3.Name,
Extent3.Ordinal AS C1,
Extent3.IsNullable,
Extent3.TypeName,
Extent3.MaxLength AS C2,
Extent3.Precision AS C3,
Extent3.DateTimePrecision,
Extent3.Scale AS C4,
Extent3.IsIdentity,
Extent3.IsStoreGenerated,
6 AS C5,
Extent3.ParentId
FROM
(SELECT /
View columns / CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS UNSIGNED INTEGER)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS UNSIGNED INTEGER)
ELSE 0
END AS Precision,
0 AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent3)) AS UnionAll1
ON (0 = UnionAll1.C5)
AND (Extent1.Id = UnionAll1.ParentId) LEFT OUTER
JOIN
(SELECT UnionAll2.Id AS C1,
1 AS C2
FROM
(SELECT /
Constraints / CONCAT(CONSTRAINT_SCHEMA,
‘.’, TABLE_NAME, ‘.’, CONSTRAINT_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, CONSTRAINT_NAME AS Name, CONSTRAINT_TYPE AS ConstraintType, 0 AS IsDeferrable, 0 AS IsInitiallyDeferred
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE != ‘CHECK’
AND TABLE_SCHEMA=schema() ) AS Extent4
INNER JOIN (
(SELECT 7 AS C1,
Extent5.ConstraintId,
Extent6.Id
FROM
(SELECT /
Constraint columns / CONCAT(CONSTRAINT_SCHEMA,
‘.’, TABLE_NAME, ‘.’, CONSTRAINT_NAME) AS ConstraintId, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS ColumnId
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_SCHEMA=schema() ) AS Extent5
INNER JOIN
(SELECT /
Table columns / CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS CHAR)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS CHAR)
ELSE 0
END AS Precision,
DATETIME_PRECISION AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent6
ON Extent6.Id = Extent5.ColumnId)
UNION
ALL
(SELECT 11 AS C1,
Extent7.ConstraintId,
Extent8.Id
FROM
(SELECT /
View constraint columns / NULL AS ConstraintId,
NULL AS ColumnId ) AS Extent7
INNER JOIN
(SELECT /
View columns */ CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS UNSIGNED INTEGER)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS UNSIGNED INTEGER)
ELSE 0
END AS Precision,
0 AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent8
ON Extent8.Id = Extent7.ColumnId)) AS UnionAll2
ON (7 = UnionAll2.C1)
AND (Extent4.Id = UnionAll2.ConstraintId)
WHERE Extent4.ConstraintType = ‘PRIMARY KEY’) AS Project5
ON UnionAll1.Id = Project5.C1
WHERE Extent1.Name LIKE ‘%’

假设test库下有一张表有两个字段,id和name。
use test,然后执行原始sql:
在4.0.15下面,执行结果是正常查出来两个字段,id和name
在6.5.3下面,却查出来4个字段,2个id和2个name。
(随便找一个有表的库,use这个库后执行上面的原始sql,都会发现,6.5.3查出来的数据总是比4.0.15查出来的数据多一倍)

这里将上楼原始sql中,有问题的sql摘出来,再修改下,是这样的:

select * from (
(SELECT Extent2.Id,
Extent2.Name,
Extent2.Ordinal AS C1,
Extent2.IsNullable,
Extent2.TypeName,
Extent2.MaxLength AS C2,
Extent2.Precision AS C3,
Extent2.DateTimePrecision,
Extent2.Scale AS C4,
Extent2.IsIdentity,
Extent2.IsStoreGenerated,
0 AS C5,
Extent2.ParentId
FROM
(SELECT /* Table columns / CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS CHAR)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS CHAR)
ELSE 0
END AS Precision,
DATETIME_PRECISION AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent2)
UNION
ALL
(SELECT Extent3.Id,
Extent3.Name,
Extent3.Ordinal AS C1,
Extent3.IsNullable,
Extent3.TypeName,
Extent3.MaxLength AS C2,
Extent3.Precision AS C3,
Extent3.DateTimePrecision,
Extent3.Scale AS C4,
Extent3.IsIdentity,
Extent3.IsStoreGenerated,
6 AS C5,
Extent3.ParentId
FROM
(SELECT /
View columns */ CONCAT(TABLE_SCHEMA,
‘.’, TABLE_NAME, ‘.’, COLUMN_NAME) AS Id, CONCAT(TABLE_SCHEMA, ‘.’, TABLE_NAME) AS ParentId, COLUMN_NAME AS Name, ORDINAL_POSITION AS Ordinal,
CASE IS_NULLABLE
WHEN ‘YES’ THEN
1
ELSE 0
END AS IsNullable, IF(LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’, IF (LEFT(COLUMN_TYPE,10) = ‘binary(16)’
OR LEFT(COLUMN_TYPE,8) = ‘char(36)’, ‘guid’, IF (INSTR(COLUMN_TYPE, ‘unsigned’) = 0, DATA_TYPE, CONCAT(‘u’, DATA_TYPE)))) AS TypeName, IF (CHARACTER_MAXIMUM_LENGTH > 2147483647, 2147483647, CHARACTER_MAXIMUM_LENGTH) AS MaxLength,
CASE
WHEN NUMERIC_PRECISION > 0 THEN
CAST(NUMERIC_PRECISION AS UNSIGNED INTEGER)
WHEN DATETIME_PRECISION > 0 THEN
CAST(DATETIME_PRECISION AS UNSIGNED INTEGER)
ELSE 0
END AS Precision,
0 AS DateTimePrecision,
NUMERIC_SCALE AS Scale,
NULL AS CollationCatalog,
NULL AS CollationSchema,
COLLATION_NAME AS CollationName,
NULL AS CharacterSetCatalog,
NULL AS CharacterSetSchema,
CHARACTER_SET_NAME AS CharacterSetName,
0 AS IsMultiSet,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsIdentity,
CASE
WHEN COLUMN_DEFAULT LIKE ‘CURRENT_TIMESTAMP’ THEN
1
WHEN EXTRA LIKE ‘%auto%’ THEN
1
ELSE 0
END AS IsStoreGenerated, COLUMN_DEFAULT AS Default
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA=schema() ) AS Extent3)) AS UnionAll1
where (0 = UnionAll1.C5)

它的抽象逻辑其实是这样的:
select * from (
select 1 C5 from INFORMATION_SCHEMA.COLUMNS where table_schema=‘test’
union all
select 6 C5 from INFORMATION_SCHEMA.COLUMNS where table_schema=‘test’
) t where t.C5 =1 ;

由于6.5.3无法把C5=6的值给过滤掉,所以6.5.3比4.0.15的执行结果要多出一倍的数据。
因此原始sql执行后,在6.5.3会出现重复的字段,从而ef框架报出重复字段的错误。

1 个赞