Browse Source

Update entity manager

pull/14/head
sunkaixuan 3 years ago
parent
commit
b31f7118b0
  1. 20
      Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs

20
Src/Asp.Net/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs

@ -170,7 +170,15 @@ namespace SqlSugar
/// <returns>the code annotation for the database table</returns>
public string GetTableAnnotation(Type entityType)
{
return GetXElementNodeValue(entityType, $"T:{entityType.FullName}");
var result= GetXElementNodeValue(entityType, $"T:{entityType.FullName}");
if (string.IsNullOrEmpty(result))
{
return null;
}
else
{
return result;
}
}
/// <summary>
/// Gets the code annotation for the field
@ -180,7 +188,15 @@ namespace SqlSugar
/// <returns>the code annotation for the field</returns>
public string GetPropertyAnnotation(Type entityType, string dbColumnName)
{
return GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}");
var result= GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}");
if (string.IsNullOrEmpty(result))
{
return null;
}
else
{
return result;
}
}
#region Primary key

Loading…
Cancel
Save