mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update core
This commit is contained in:
parent
c2c224c4af
commit
bd7057d162
@ -145,7 +145,12 @@ namespace SqlSugar
|
|||||||
/// <returns>the text contents of this XML element node</returns>
|
/// <returns>the text contents of this XML element node</returns>
|
||||||
public string GetXElementNodeValue(Type entityType, string nodeAttributeName)
|
public string GetXElementNodeValue(Type entityType, string nodeAttributeName)
|
||||||
{
|
{
|
||||||
FileInfo file = new FileInfo(entityType.Assembly.Location);
|
var path = entityType.Assembly.Location;
|
||||||
|
if (string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
FileInfo file = new FileInfo(path);
|
||||||
string xmlPath = entityType.Assembly.Location.Replace(file.Extension, ".xml");
|
string xmlPath = entityType.Assembly.Location.Replace(file.Extension, ".xml");
|
||||||
if (!File.Exists(xmlPath))
|
if (!File.Exists(xmlPath))
|
||||||
{
|
{
|
||||||
@ -170,6 +175,10 @@ namespace SqlSugar
|
|||||||
/// <returns>the code annotation for the database table</returns>
|
/// <returns>the code annotation for the database table</returns>
|
||||||
public string GetTableAnnotation(Type entityType)
|
public string GetTableAnnotation(Type entityType)
|
||||||
{
|
{
|
||||||
|
if (entityType.IsClass() == false)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var result= GetXElementNodeValue(entityType, $"T:{entityType.FullName}");
|
var result= GetXElementNodeValue(entityType, $"T:{entityType.FullName}");
|
||||||
if (string.IsNullOrEmpty(result))
|
if (string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
@ -188,6 +197,10 @@ namespace SqlSugar
|
|||||||
/// <returns>the code annotation for the field</returns>
|
/// <returns>the code annotation for the field</returns>
|
||||||
public string GetPropertyAnnotation(Type entityType, string dbColumnName)
|
public string GetPropertyAnnotation(Type entityType, string dbColumnName)
|
||||||
{
|
{
|
||||||
|
if (entityType.IsClass() == false)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var result= GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}");
|
var result= GetXElementNodeValue(entityType, $"P:{entityType.FullName}.{dbColumnName}");
|
||||||
if (string.IsNullOrEmpty(result))
|
if (string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user