Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
d689adbecf
  1. BIN
      .vs/SqlSugar/v14/.suo
  2. BIN
      OrmTest/bin/Debug/OrmTest.exe
  3. BIN
      OrmTest/bin/Debug/OrmTest.pdb
  4. BIN
      OrmTest/bin/Debug/SqlSugar.dll
  5. BIN
      OrmTest/bin/Debug/SqlSugar.pdb
  6. BIN
      OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache
  7. BIN
      OrmTest/obj/Debug/OrmTest.exe
  8. BIN
      OrmTest/obj/Debug/OrmTest.pdb
  9. 1
      SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs
  10. 24
      SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs
  11. BIN
      SqlSugar/bin/Debug/SqlSugar.dll
  12. BIN
      SqlSugar/bin/Debug/SqlSugar.pdb
  13. BIN
      SqlSugar/obj/Debug/SqlSugar.dll
  14. BIN
      SqlSugar/obj/Debug/SqlSugar.pdb

BIN
.vs/SqlSugar/v14/.suo

Binary file not shown.

BIN
OrmTest/bin/Debug/OrmTest.exe

Binary file not shown.

BIN
OrmTest/bin/Debug/OrmTest.pdb

Binary file not shown.

BIN
OrmTest/bin/Debug/SqlSugar.dll

Binary file not shown.

BIN
OrmTest/bin/Debug/SqlSugar.pdb

Binary file not shown.

BIN
OrmTest/obj/Debug/OrmTest.csprojResolveAssemblyReference.cache

Binary file not shown.

BIN
OrmTest/obj/Debug/OrmTest.exe

Binary file not shown.

BIN
OrmTest/obj/Debug/OrmTest.pdb

Binary file not shown.

1
SqlSugar/ExpressionsToSql/Common/ExpressionParameter.cs

@ -16,5 +16,6 @@ namespace SqlSugar
public List<KeyValuePair<string, BinaryExpressionInfo>> BinaryExpressionInfoList { get; set; }
public object TempDate { get; set; }
public ExpressionParameter BaseParameter { get; set; }
public int SwitchCaseNumber { get; set; }
}
}

24
SqlSugar/ExpressionsToSql/ResolveItems/NewExpressionResolve.cs

@ -41,7 +41,7 @@ namespace SqlSugar
foreach (var item in expression.Arguments)
{
++i;
if (item.NodeType == ExpressionType.Constant)
if (item.NodeType == ExpressionType.Constant || (item is MemberExpression) && ((MemberExpression)item).Expression.NodeType == ExpressionType.Constant)
{
base.Expression = item;
base.Start();
@ -52,26 +52,15 @@ namespace SqlSugar
else
{
var memberExpression = (MemberExpression)item;
if (memberExpression.Expression.NodeType.IsIn(ExpressionType.Constant))
var fieldNme = (memberExpression).Member.Name;
if (isSingle)
{
base.Expression = memberExpression;
base.Start();
string parameterName = this.Context.SqlParameterKeyWord + "constant" + i;
parameter.Context.Result.Append(parameterName);
this.Context.Parameters.Add(new SugarParameter(parameterName, parameter.TempDate));
parameter.Context.Result.Append(fieldNme);
}
else
{
var fieldNme = (memberExpression).Member.Name;
if (isSingle)
{
parameter.Context.Result.Append(fieldNme);
}
else
{
var shortName = memberExpression.Expression.ToString();
parameter.Context.Result.Append(shortName + "." + fieldNme);
}
var shortName = memberExpression.Expression.ToString();
parameter.Context.Result.Append(shortName + "." + fieldNme);
}
}
}
@ -79,3 +68,4 @@ namespace SqlSugar
}
}
}

BIN
SqlSugar/bin/Debug/SqlSugar.dll

Binary file not shown.

BIN
SqlSugar/bin/Debug/SqlSugar.pdb

Binary file not shown.

BIN
SqlSugar/obj/Debug/SqlSugar.dll

Binary file not shown.

BIN
SqlSugar/obj/Debug/SqlSugar.pdb

Binary file not shown.
Loading…
Cancel
Save