mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-15 15:15:47 +08:00
- 优化 表达式 true && ... 解析的处理;
- 优化 Navigate 指定联合键关系时,对属性顺序的要求,当类型不一样、名称一样时无须指明属性的顺序,如:[Navigate("MemberId, ShopId")];
This commit is contained in:
@@ -568,6 +568,19 @@ namespace FreeSql.Internal
|
||||
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
|
||||
//if (isLazy) throw nvref.Exception;
|
||||
}
|
||||
if (trytb.Primarys.Length > 1)
|
||||
{
|
||||
if (trytb.Primarys.Select(a => a.CsType).Distinct().Count() == trytb.Primarys.Length)
|
||||
{
|
||||
var pkList = trytb.Primarys.ToList();
|
||||
bindColumns.Sort((a, b) => pkList.FindIndex(c => c.CsType == a.CsType).CompareTo(pkList.FindIndex(c => c.CsType == b.CsType)));
|
||||
}
|
||||
else if (string.Compare(string.Join(",", trytb.Primarys.Select(a => a.CsName).OrderBy(a => a)), string.Join(",", bindColumns.Select(a => a.CsName).OrderBy(a => a)), true) == 0)
|
||||
{
|
||||
var pkList = trytb.Primarys.ToList();
|
||||
bindColumns.Sort((a, b) => pkList.FindIndex(c => string.Compare(c.CsName, a.CsName, true) == 0).CompareTo(pkList.FindIndex(c => string.Compare(c.CsName, b.CsName, true) == 0)));
|
||||
}
|
||||
}
|
||||
for (var a = 0; nvref.Exception == null && a < trytb.Primarys.Length; a++)
|
||||
{
|
||||
var findtrytbPkCsName = trytb.Primarys[a].CsName.TrimStart('_');
|
||||
@@ -705,6 +718,19 @@ namespace FreeSql.Internal
|
||||
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
|
||||
//if (isLazy) throw nvref.Exception;
|
||||
}
|
||||
if (tbref.Primarys.Length > 1)
|
||||
{
|
||||
if (tbref.Primarys.Select(a => a.CsType).Distinct().Count() == tbref.Primarys.Length)
|
||||
{
|
||||
var pkList = tbref.Primarys.ToList();
|
||||
bindColumns.Sort((a, b) => pkList.FindIndex(c => c.CsType == a.CsType).CompareTo(pkList.FindIndex(c => c.CsType == b.CsType)));
|
||||
}
|
||||
else if (string.Compare(string.Join(",", tbref.Primarys.Select(a => a.CsName).OrderBy(a => a)), string.Join(",", bindColumns.Select(a => a.CsName).OrderBy(a => a)), true) == 0)
|
||||
{
|
||||
var pkList = tbref.Primarys.ToList();
|
||||
bindColumns.Sort((a, b) => pkList.FindIndex(c => string.Compare(c.CsName, a.CsName, true) == 0).CompareTo(pkList.FindIndex(c => string.Compare(c.CsName, b.CsName, true) == 0)));
|
||||
}
|
||||
}
|
||||
for (var a = 0; nvref.Exception == null && a < tbref.Primarys.Length; a++)
|
||||
{
|
||||
var findtbrefPkCsName = tbref.Primarys[a].CsName.TrimStart('_');
|
||||
|
||||
Reference in New Issue
Block a user