Click or drag to resize

ProjectionLambdaTransformer Class

Visitor, which transforms a passed in lambda into a proper projector lambda for WithProjector and extracts the elements to pass to Select(params object[]). Uses a caching mechanism which caches the compiled result of a lambda based on the string representation of the lambda. This can increase performance. The caching is tweakable and can be switched off. (See static members of this class). If a lambda contains a constant expression, the lambda isn't cached to avoid caching a lambda referencing a local variable and keeping the object containing the local variable into memory.
Inheritance Hierarchy

Namespace:  SD.LLBLGen.Pro.QuerySpec
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.7.0.0 (5.7.0)
Syntax
public class ProjectionLambdaTransformer : GenericExpressionHandler

The ProjectionLambdaTransformer type exposes the following members.

Constructors
  NameDescription
Public methodProjectionLambdaTransformer
Initializes a new instance of the ProjectionLambdaTransformer class.
Top
Methods
  NameDescription
Public methodConvertToProjectorLambdaT
Converts the specified expression to a projector lambda. The expression is first handled, which converts elements properly and then converted into a lambda, where the passed in, altered expression is used as the body.
Public methodCreateDataReaderProjectorFuncT
Creates the projector func which can be used to instantiate a new instance of T from a ProjectionRow instance.
Public methodCreateProjectorFuncT
Creates the projector func which can be used to instantiate a new instance of T from a ProjectionRow instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandleBinaryExpression
Handles the binary expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleBinaryExpressionArithmeticOrBitOperator
Handles the binary expression with arithmetic or bit operator.
(Inherited from GenericExpressionHandler.)
Protected methodHandleBinaryExpressionBooleanOperator
Handles the binary expression with a boolean operator.
(Inherited from GenericExpressionHandler.)
Protected methodHandleConditionalExpression
Handles the conditional expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleConstantExpression
Handles the constant expression.
(Overrides GenericExpressionHandlerHandleConstantExpression(ConstantExpression).)
Protected methodHandleElementInitializer
Handles the element initializer.
(Inherited from GenericExpressionHandler.)
Protected methodHandleElementInitializerList
Handles the element initializer list.
(Inherited from GenericExpressionHandler.)
Public methodHandleExpression
Handles the expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleExpressionList
Handles the expression list.
(Inherited from GenericExpressionHandler.)
Protected methodHandleInvocationExpression
Handles the invocation expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleLambdaExpression
Handles the lambda expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleListInitExpression
Handles the list init expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberAssignment
Handles the member assignment.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberBinding
Handles the member binding.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberBindingList
Handles the member binding list.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberExpression
Handles the member expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberInitExpression
Handles the member init expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberListBinding
Handles the member list binding.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMemberMemberBinding
Handles the member member binding.
(Inherited from GenericExpressionHandler.)
Protected methodHandleMethodCallExpression
Handles the method call expression.
(Overrides GenericExpressionHandlerHandleMethodCallExpression(MethodCallExpression).)
Protected methodHandleNewArrayExpression
Handles the new array expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleNewExpression
Handles the NewExpression expression
(Inherited from GenericExpressionHandler.)
Protected methodHandleParameterExpression
Handles the parameter expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleTypeBinaryExpression
Handles the type binary expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleUnaryArrayLength
Handles the length of the unary array.
(Inherited from GenericExpressionHandler.)
Protected methodHandleUnaryConvertExpression
Handles the unary convert expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleUnaryExpression
Handles the unary expression.
(Inherited from GenericExpressionHandler.)
Protected methodHandleUnaryNotExpression
Handles the unary expression of type 'Not'.
(Inherited from GenericExpressionHandler.)
Protected methodHandleUnaryTypeAsExpression
Handles the unary type as expression.
(Inherited from GenericExpressionHandler.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberCacheCompiledLamdbas
Flag which signals whether compiled lambda's should be cached (true) or that they have to be compiled every time (false). Switch to false if caching gives memory problems or otherwise odd results.
Public fieldStatic memberCacheMaxEntriesPerThread
Static value which has appdomain scope, and which controls the cache size for the compiled lambdas per thread. Every time the cache hits the set limit, it's cleared. Compiling lambda's is done in Select(lambda) calls to create typed projections.
Top
See Also