Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
24b53f7435
  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. 14
      SqlSugar/Entities/ExpressionParameter.cs
  10. 7
      SqlSugar/Expressions/ExpItems/BaseResolve.cs
  11. 9
      SqlSugar/Expressions/ExpItems/BinaryExpressionResolve.cs
  12. 5
      SqlSugar/Expressions/ExpItems/MemberExpressionResolve.cs
  13. 16
      SqlSugar/Expressions/ExpressionContext.cs
  14. 4
      SqlSugar/SqlSugar.csproj
  15. BIN
      SqlSugar/bin/Debug/SqlSugar.dll
  16. BIN
      SqlSugar/bin/Debug/SqlSugar.pdb
  17. 1
      SqlSugar/obj/Debug/SqlSugar.csproj.FileListAbsolute.txt
  18. BIN
      SqlSugar/obj/Debug/SqlSugar.csprojResolveAssemblyReference.cache
  19. BIN
      SqlSugar/obj/Debug/SqlSugar.dll
  20. 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.

14
SqlSugar/Entities/ExpressionParameter.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class ExpressionParameter
{
public Expression Expression { get; set; }
public SqlSugarClient DbContext { get; set; }
}
}

7
SqlSugar/Expressions/ExpItems/BaseResolve.cs

@ -8,10 +8,13 @@ namespace SqlSugar
public class BaseResolve
{
protected Expression Expression { get; set; }
protected Expression BaseExpression { get; set; }
public ExpressionContext Context { get; set; }
public string SqlWhere { get; set; }
public bool IsFinished { get; set; }
public bool? IsLeft { get; set; }
public int ContentIndex { get { return this.Context.Index; } }
public int Index { get; set; }
private BaseResolve()
{
@ -23,7 +26,9 @@ namespace SqlSugar
public BaseResolve Start()
{
this.Index++;
this.IsFinished = false;
this.BaseExpression = null;
Expression exp = this.Expression;
if (exp is LambdaExpression)
{

9
SqlSugar/Expressions/ExpItems/BinaryExpressionResolve.cs

@ -9,6 +9,15 @@ namespace SqlSugar
{
public BinaryExpressionResolve(Expression exp) : base(exp)
{
var expression = this.Expression as BinaryExpression;
base.BaseExpression = expression;
base.IsLeft = true;
base.Expression = expression.Left;
base.Start();
base.IsLeft = false;
base.Expression = expression.Right;
base.Start();
base.IsLeft = null;
base.Continue();
}
}

5
SqlSugar/Expressions/ExpItems/MemberExpressionResolve.cs

@ -10,7 +10,10 @@ namespace SqlSugar
{
public MemberExpressionResolve(Expression exp) : base(exp)
{
var isLeft = this.IsLeft;
this.IsLeft = null;
var isSingle=base.Context.IsSingle;
var expression = exp as MemberExpression;
}
}
}

16
SqlSugar/Expressions/ExpressionContext.cs

@ -8,20 +8,20 @@ namespace SqlSugar
{
public class ExpressionContext : ExpResolveAccessory
{
private ResolveExpressType type { get; set; }
private Expression expression { get; set; }
private bool IsSingle { get { return this.type == ResolveExpressType.Single; } }
public ResolveExpressType Type { get; set; }
public Expression Expression { get; set; }
public bool IsSingle { get { return this.Type == ResolveExpressType.Single; } }
public ExpressionContext(Expression expression, ResolveExpressType type)
{
this.type = type;
this.expression = expression;
this.Type = type;
this.Expression = expression;
}
public string GetFiledName()
{
string reval = null;
LambdaExpression lambda = this.expression as LambdaExpression;
LambdaExpression lambda = this.Expression as LambdaExpression;
var isConvet = lambda.Body.NodeType.IsIn(ExpressionType.Convert);
var isMember = lambda.Body.NodeType.IsIn(ExpressionType.MemberAccess);
if (!isConvet && !isMember)
@ -56,7 +56,7 @@ namespace SqlSugar
public string GetWhere()
{
BaseResolve resolve = new BaseResolve(this.expression);
BaseResolve resolve = new BaseResolve(this.Expression);
resolve.Context = this;
resolve.Start();
return resolve.SqlWhere;
@ -75,5 +75,7 @@ namespace SqlSugar
base._Parameters = value;
}
}
public int Index { get; set; }
}
}

4
SqlSugar/SqlSugar.csproj

@ -97,6 +97,7 @@
<Compile Include="Entities\ConnectionConfig.cs" />
<Compile Include="Entities\DbColumnInfo.cs" />
<Compile Include="Entities\DbTableInfo.cs" />
<Compile Include="Entities\ExpressionParameter.cs" />
<Compile Include="Entities\JoinQueryInfo.cs" />
<Compile Include="Entities\Mapping\MappingColumn.cs" />
<Compile Include="Entities\Mapping\MappingTable.cs" />
@ -135,9 +136,6 @@
<Compile Include="SqlSugarAccessory.cs" />
<Compile Include="SqlSugarClient.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<Content Include="Lib\Newtonsoft.Json.dll" />
</ItemGroup>

BIN
SqlSugar/bin/Debug/SqlSugar.dll

Binary file not shown.

BIN
SqlSugar/bin/Debug/SqlSugar.pdb

Binary file not shown.

1
SqlSugar/obj/Debug/SqlSugar.csproj.FileListAbsolute.txt

@ -3,3 +3,4 @@ F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\bin\Debug\SqlSugar.pdb
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\bin\Debug\Newtonsoft.Json.dll
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.dll
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.pdb
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.csprojResolveAssemblyReference.cache

BIN
SqlSugar/obj/Debug/SqlSugar.csprojResolveAssemblyReference.cache

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