mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 01:47:06 +08:00
Code optimization
This commit is contained in:
parent
cd77614213
commit
6f658bd785
@ -16,6 +16,8 @@ namespace SqlSugar
|
||||
public const string SqlFuncFullName = "SqlSugar.SqlFunc";
|
||||
public const string MethodConst = "MethodConst";
|
||||
public const string Const = "Const";
|
||||
public const string Dot = ".";
|
||||
public const char DotChar = '.';
|
||||
public readonly static Type MemberExpressionType = typeof(MemberExpression);
|
||||
public readonly static Type ConstantExpressionType = typeof(ConstantExpression);
|
||||
}
|
||||
|
@ -106,16 +106,16 @@ namespace SqlSugar
|
||||
Check.ArgumentNullException(entityName, string.Format(ErrorMessage.ObjNotExist, "Table Name"));
|
||||
if (IsTranslationText(entityName)) return entityName;
|
||||
isMapping = isMapping && this.MappingTables.IsValuable();
|
||||
var isComplex = entityName.Contains(".");
|
||||
var isComplex = entityName.Contains(ExpressionConst.Dot);
|
||||
if (isMapping && isComplex)
|
||||
{
|
||||
var columnInfo = entityName.Split('.');
|
||||
var columnInfo = entityName.Split(ExpressionConst.DotChar);
|
||||
var mappingInfo = this.MappingTables.FirstOrDefault(it => it.EntityName.Equals(columnInfo.Last(), StringComparison.CurrentCultureIgnoreCase));
|
||||
if (mappingInfo != null)
|
||||
{
|
||||
columnInfo[columnInfo.Length - 1] = mappingInfo.EntityName;
|
||||
}
|
||||
return string.Join(".", columnInfo.Select(it => GetTranslationText(it)));
|
||||
return string.Join(ExpressionConst.Dot, columnInfo.Select(it => GetTranslationText(it)));
|
||||
}
|
||||
else if (isMapping)
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace SqlSugar
|
||||
}
|
||||
else if (isComplex)
|
||||
{
|
||||
return string.Join(".", entityName.Split('.').Select(it => GetTranslationText(it)));
|
||||
return string.Join(ExpressionConst.Dot, entityName.Split(ExpressionConst.DotChar).Select(it => GetTranslationText(it)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user