C# 클래스 Pathoschild.WebApi.NhibernateOdata.Internal.FixStringMethodsVisitor

Intercepts queries before they're parsed by NHibernate to rewrite unsupported lambdas for string.Contains, string.StartsWith(string) and string.EndsWith(string).
The expression tree generated by the ODataQueryOptions.ApplyTo method looks like the following sample. .Lambda #Lambda1<System.Func`2[Pathoschild.WebApi.NhibernateOdata.Tests.Models.Parent,System.Boolean]>(Pathoschild.WebApi.NhibernateOdata.Tests.Models.Parent $$it) { (.If ( $$it.Name == null | .Constant<System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.String]>(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.String]).TypedProperty == null ) { null } .Else { (System.Nullable`1[System.Boolean]).Call ($$it.Name).Contains(.Constant<System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.String]>(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.String]).TypedProperty) } == (System.Nullable`1[System.Boolean]).Constant<System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.Boolean]>(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1[System.Boolean]).TypedProperty) == .Constant<System.Nullable`1[System.Boolean]>(True) } The actual System.Web.Http.OData parser DOES NOT support the "replace" string method, so we can't make it go through NHibernate.
상속: System.Linq.Expressions.ExpressionVisitor
파일 보기 프로젝트 열기: Pathoschild/webapi.nhibernate-odata 1 사용 예제들

공개 메소드들

메소드 설명
FixStringMethodsVisitor ( ) : System.Collections.Generic

Constructs an instance.

Visit ( Expression node ) : Expression

Dispatches the expression to one of the more specialized visit methods in this class.

비공개 메소드들

메소드 설명
HandleConditionalExpression ( Expression original, ConditionalExpression ifElse ) : Expression

Handles the conditional expression (equivalent to .If {} .Else {} in the sample expression tree in the FixStringMethodsVisitor remarks).

메소드 상세

FixStringMethodsVisitor() 공개 메소드

Constructs an instance.
public FixStringMethodsVisitor ( ) : System.Collections.Generic
리턴 System.Collections.Generic

Visit() 공개 메소드

Dispatches the expression to one of the more specialized visit methods in this class.
public Visit ( Expression node ) : Expression
node System.Linq.Expressions.Expression The expression to visit.
리턴 System.Linq.Expressions.Expression