Browse Source
!31 修复codefirst从xml读取属性注释时没有读取父属性注释
Merge pull request !31 from yanghs/master
pull/32/head
sunkaixuan
2 years ago
committed by
Gitee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with
8 additions and
6 deletions
-
Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs
-
Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs
|
|
@ -234,14 +234,15 @@ namespace SqlSugar |
|
|
|
/// <returns>the code annotation for the field</returns>
|
|
|
|
public string GetPropertyAnnotation(Type entityType, string dbColumnName) |
|
|
|
{ |
|
|
|
if (entityType.IsClass() == false) |
|
|
|
if (entityType.IsClass() == false || entityType == typeof(object)) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
} |
|
|
|
var result= GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}"); |
|
|
|
|
|
|
|
var result = GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}"); |
|
|
|
if (string.IsNullOrEmpty(result)) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
return GetPropertyAnnotation(entityType.BaseType, dbColumnName); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
@ -234,14 +234,15 @@ namespace SqlSugar |
|
|
|
/// <returns>the code annotation for the field</returns>
|
|
|
|
public string GetPropertyAnnotation(Type entityType, string dbColumnName) |
|
|
|
{ |
|
|
|
if (entityType.IsClass() == false) |
|
|
|
if (entityType.IsClass() == false || entityType == typeof(object)) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
} |
|
|
|
var result= GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}"); |
|
|
|
|
|
|
|
var result = GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}"); |
|
|
|
if (string.IsNullOrEmpty(result)) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
return GetPropertyAnnotation(entityType.BaseType, dbColumnName); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|