mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update .net core project
This commit is contained in:
@@ -486,6 +486,31 @@ namespace SqlSugar
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!this.Context.IsJoin && (item is MemberInitExpression || item is NewExpression))
|
||||||
|
{
|
||||||
|
List<NewExpressionInfo> newExpressionInfos = new List<NewExpressionInfo>();
|
||||||
|
if (item is MemberInitExpression)
|
||||||
|
{
|
||||||
|
newExpressionInfos = ExpressionTool.GetNewexpressionInfos(item, this.Context);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newExpressionInfos = ExpressionTool.GetNewDynamicexpressionInfos(item, this.Context);
|
||||||
|
}
|
||||||
|
mappingKeys = new Dictionary<string, string>();
|
||||||
|
foreach (NewExpressionInfo newExpressionInfo in newExpressionInfos)
|
||||||
|
{
|
||||||
|
//var property=item.Type.GetProperties().Where(it => it.Name == newExpressionInfo.l).First();
|
||||||
|
//asName = GetAsName(item, newExpressionInfo.ShortName, property);
|
||||||
|
mappingKeys.Add("Single_"+newExpressionInfo.LeftNameName,asName + "." + newExpressionInfo.RightDbName );
|
||||||
|
CallContextThread<Dictionary<string, string>>.SetData("Exp_Select_Mapping_Key", mappingKeys);
|
||||||
|
CallContextAsync<Dictionary<string, string>>.SetData("Exp_Select_Mapping_Key", mappingKeys);
|
||||||
|
parameter.Context.Result.Append(this.Context.GetAsString(
|
||||||
|
this.Context.SqlTranslationLeft + asName + "." + newExpressionInfo.RightDbName + this.Context.SqlTranslationRight,
|
||||||
|
newExpressionInfo.RightDbName
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
asName = GetAsNameResolveAnObject(parameter, item, asName, isSameType);
|
asName = GetAsNameResolveAnObject(parameter, item, asName, isSameType);
|
||||||
|
@@ -168,7 +168,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
result.Add(name, null);
|
if (!result.ContainsKey(name))
|
||||||
|
{
|
||||||
|
result.Add(name, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -447,6 +450,11 @@ namespace SqlSugar
|
|||||||
key = mappingKeys[item.Name]+"."+typeName + "." + name;
|
key = mappingKeys[item.Name]+"."+typeName + "." + name;
|
||||||
info = readerValues.Select(it => it.Key).FirstOrDefault(it => it.ToLower() == key.ToLower());
|
info = readerValues.Select(it => it.Key).FirstOrDefault(it => it.ToLower() == key.ToLower());
|
||||||
}
|
}
|
||||||
|
else if (mappingKeys != null && mappingKeys.ContainsKey("Single_" + name))
|
||||||
|
{
|
||||||
|
key =mappingKeys["Single_" + name];
|
||||||
|
info = readerValues.Select(it => it.Key).FirstOrDefault(it => it.ToLower() == key.ToLower());
|
||||||
|
}
|
||||||
if (info == null&&oldInfo!=null)
|
if (info == null&&oldInfo!=null)
|
||||||
{
|
{
|
||||||
info = oldInfo;
|
info = oldInfo;
|
||||||
|
Reference in New Issue
Block a user