This commit is contained in:
sunkaixuan
2017-01-08 23:27:43 +08:00
parent bfe3330c7c
commit 5d7e266ec7
16 changed files with 39 additions and 1 deletions

Binary file not shown.

View File

@@ -23,7 +23,7 @@ namespace OrmTest
{
Program.id = "xx";
string x = "1";
Expression<Func<Student, bool>> exp = it => it.Name==new Program().x;
Expression<Func<Student, object>> exp = it => new Program() { x=it.Name };
// Expression<Func<Student, object>> exp = it => it.Name;
ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.WhereSingle);
// var x = expContext.GetFiledName();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -83,6 +83,10 @@ namespace SqlSugar
{
return new UnaryExpressionResolve(parameter);
}
else if (exp is MemberInitExpression)
{
return new MemberInitExpressionResolve(parameter);
}
else if (exp != null && exp.NodeType.IsIn(ExpressionType.New, ExpressionType.NewArrayBounds, ExpressionType.NewArrayInit))
{
Check.ThrowNotSupportedException("ExpressionType.New、ExpressionType.NewArrayBounds and ExpressionType.NewArrayInit");

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class MemberInitExpressionResolve : BaseResolve
{
public MemberInitExpressionResolve(ExpressionParameter parameter) : base(parameter)
{
var expression = base.Expression as MemberInitExpression;
switch (parameter.Context.Type)
{
case ResolveExpressType.WhereSingle:
break;
case ResolveExpressType.WhereMultiple:
break;
case ResolveExpressType.SelectSingle:
break;
case ResolveExpressType.SelectMultiple:
break;
case ResolveExpressType.FieldSingle:
break;
case ResolveExpressType.FieldMultiple:
break;
default:
break;
}
}
}
}

View File

@@ -100,6 +100,7 @@
<Compile Include="ExpressionsToSql\Common\BinaryExpressionInfo.cs" />
<Compile Include="ExpressionsToSql\Common\ExpressionErrorMessage.cs" />
<Compile Include="ExpressionsToSql\ResolveItems\MemberConstExpressionResolve.cs" />
<Compile Include="ExpressionsToSql\ResolveItems\MemberInitExpressionResolve.cs" />
<Compile Include="ExpressionsToSql\ResolveItems\MemberNewExpressionResolve.cs" />
<Compile Include="ExpressionsToSql\ResolveItems\MemberNoExpressionResolve.cs" />
<Compile Include="ExpressionsToSql\Common\SugarParameter.cs" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.