C# Class System.Data.Entity.Core.Objects.ELinq.ExpressionConverter

Show file Open project: aspnet/EntityFramework6 Class Usage Examples

Private Properties

Property Type Description
AddParameter void
AddSpanMapping DbExpression
AlignTypes DbExpression
ApplySpanMapping void
CanFuncletizePropertyInfo bool
CanIncludeSpanInfo bool
CanOmitCast bool
CheckInitializerType void
Convert DbExpression
CreateCanonicalFunction DbFunctionExpression
CreateCastExpression DbExpression
CreateEqualsExpression DbExpression
CreateIsNullExpression DbExpression
CreateNewRowExpression DbNewInstanceExpression
DescribeClrType string
Distinct DbDistinctExpression
Except DbExceptExpression
ExpressionConverter System.Collections.Generic
Filter DbExpression
FindCanonicalFunction EdmFunction
FindFunction EdmFunction
GetCastTargetType TypeUsage
GetIsOrAsTargetType TypeUsage
GetLambdaExpression System.Linq.Expressions.Expression
GetLambdaExpression System.Linq.Expressions.LambdaExpression
GetParameters QueryParameterExpression>>.IEnumerable
GetTranslators IEnumerable
GetValueLayerType TypeUsage
ImplementEquality DbExpression
ImplementEqualityConstantAndUnknown DbExpression
ImplementEqualityUnknownArguments DbExpression
InitializeTranslators Translator>.Dictionary
Intersect DbIntersectExpression
IsCSharpGeneratedClass bool
IsQueryRoot bool
IsVBGeneratedClass bool
Limit DbExpression
NormalizeSetSource DbExpression
NotifyMergeOption void
OfType DbExpression
PreparePattern string
Project DbExpression
RecursivelyRewriteEqualsExpression DbExpression
Skip DbExpression
Sort DbSortExpression
ThrowUnresolvableFunction void
ThrowUnresolvableFunctionOverload void
TranslateExpression DbExpression
TranslateFunctionIntoLike DbExpression
TranslateInlineQueryOfT DbExpression
TranslateIntoCanonicalFunction DbFunctionExpression
TranslateLambda DbExpression
TranslateLambda DbExpression
TranslateLambda DbExpression
TranslateLambda DbExpression
TranslateLike DbExpression
TranslateSet DbExpression
TryGetSpan bool
TryGetValueLayerType bool
TypeUsageEquals bool
UnifySpanMappings void
UnionAll DbUnionAllExpression
ValidateAndAdjustCastTypes TypeUsage
ValidateInitializerMetadata void
VerifyRowTypeSupportedForComparison void
VerifyTypeSupportedForComparison void

Private Methods

Method Description
AddParameter ( System.Data.Entity.Core.Objects.ELinq.QueryParameterExpression queryParameter ) : void
AddSpanMapping ( DbExpression expression, Span span ) : DbExpression

Adds a new mapping from DbExpression => Span information for the specified expression, after first ensuring that the mapping dictionary has been instantiated.

AlignTypes ( DbExpression cqt, Type toClrType ) : DbExpression
ApplySpanMapping ( DbExpression from, DbExpression to ) : void

Removes the Span mapping entry for the specified from expression, and creates a new entry for the specified to expression that maps to the from expression's original Span information. If no Span information is present for the specified from expression then no changes are made to the Span mapping dictionary.

CanFuncletizePropertyInfo ( PropertyInfo propertyInfo ) : bool
CanIncludeSpanInfo ( ) : bool
CanOmitCast ( TypeUsage fromType, TypeUsage toType, bool preserveCastForDateTime ) : bool

Determines if an instance of fromType can be assigned to an instance of toType using CLR semantics. in case of primitive type, it must rely on identity since unboxing primitive requires exact match. for nominal types, rely on subtyping.

CheckInitializerType ( Type type ) : void
Convert ( ) : DbExpression
CreateCanonicalFunction ( string functionName, Expression Expression ) : DbFunctionExpression

Creates a canonical function with the given name and the given arguments

CreateCastExpression ( DbExpression source, Type toClrType, Type fromClrType ) : DbExpression
CreateEqualsExpression ( DbExpression left, DbExpression right, EqualsPattern pattern, Type leftClrType, Type rightClrType ) : DbExpression

Creates an implementation of equals using the given pattern. Throws exception when argument types are not supported for equals comparison.

CreateIsNullExpression ( DbExpression operand, Type operandClrType ) : DbExpression

Creates an implementation of IsNull. Throws exception when operand type is not supported.

CreateNewRowExpression ( DbExpression>.List columns, InitializerMetadata initializerMetadata ) : DbNewInstanceExpression
DescribeClrType ( Type clrType ) : string

Describe type for exception message.

Distinct ( DbExpression argument ) : DbDistinctExpression
Except ( DbExpression left, DbExpression right ) : DbExceptExpression
ExpressionConverter ( System.Data.Entity.Core.Objects.ELinq.Funcletizer funcletizer, Expression expression ) : System.Collections.Generic
Filter ( System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding input, DbExpression predicate ) : DbExpression
FindCanonicalFunction ( string functionName, IList argumentTypes, bool isGroupAggregateFunction, Expression Expression ) : EdmFunction

Finds a canonical function with the given functionName and argumentTypes

FindFunction ( string namespaceName, string functionName, IList argumentTypes, bool isGroupAggregateFunction, Expression Expression ) : EdmFunction

Finds a function with the given namespaceName, functionName and argumentTypes

GetCastTargetType ( TypeUsage fromType, Type toClrType, Type fromClrType, bool preserveCastForDateTime ) : TypeUsage

Gets the target type for a CQT cast operation.

GetIsOrAsTargetType ( ExpressionType operationType, Type toClrType, Type fromClrType ) : TypeUsage

Gets the target type for an Is or As expression.

GetLambdaExpression ( Expression argument ) : Expression
GetLambdaExpression ( MethodCallExpression callExpression, int argumentOrdinal ) : LambdaExpression
GetParameters ( ) : QueryParameterExpression>>.IEnumerable
GetTranslators ( ) : IEnumerable
GetValueLayerType ( Type linqType ) : TypeUsage
ImplementEquality ( DbExpression left, DbExpression right, EqualsPattern pattern ) : DbExpression
ImplementEqualityConstantAndUnknown ( DbConstantExpression constant, DbExpression unknown, EqualsPattern pattern ) : DbExpression
ImplementEqualityUnknownArguments ( DbExpression left, DbExpression right, EqualsPattern pattern ) : DbExpression
InitializeTranslators ( ) : Translator>.Dictionary
Intersect ( DbExpression left, DbExpression right ) : DbIntersectExpression
IsCSharpGeneratedClass ( string typeName, string pattern ) : bool
IsQueryRoot ( Expression Expression ) : bool
IsVBGeneratedClass ( string typeName, string pattern ) : bool
Limit ( DbExpression argument, DbExpression limit ) : DbExpression
NormalizeSetSource ( DbExpression input ) : DbExpression
NotifyMergeOption ( MergeOption mergeOption ) : void
OfType ( DbExpression argument, TypeUsage ofType ) : DbExpression
PreparePattern ( string patternValue, bool insertPercentAtStart, bool insertPercentAtEnd, bool &specifyEscape ) : string

Prepare the given input patternValue into a pattern to be used in a LIKE expression by first escaping it by the provider and then appending "%" and the beginging/end depending on whether insertPercentAtStart/insertPercentAtEnd is specified.

Project ( System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding input, DbExpression projection ) : DbExpression
RecursivelyRewriteEqualsExpression ( DbExpression left, DbExpression right, EqualsPattern pattern ) : DbExpression
Skip ( System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding input, DbExpression skipCount ) : DbExpression
Sort ( System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding input, IList keys ) : DbSortExpression
ThrowUnresolvableFunction ( Expression Expression ) : void

Helper method for FindFunction

ThrowUnresolvableFunctionOverload ( Expression Expression, bool isAmbiguous ) : void

Helper method for FindCanonicalFunction

TranslateExpression ( Expression linq ) : DbExpression
TranslateFunctionIntoLike ( MethodCallExpression call, bool insertPercentAtStart, bool insertPercentAtEnd, Func defaultTranslator ) : DbExpression

Helper method for String.StartsWith, String.EndsWith and String.Contains object.Method(argument), where Method is one of String.StartsWith, String.EndsWith or String.Contains is translated into: 1) If argument is a constant or parameter and the provider supports escaping: object like ("%") + argument1 + ("%"), where argument1 is argument escaped by the provider and ("%") are appended on the begining/end depending on whether insertPercentAtStart/insertPercentAtEnd are specified 2) Otherwise: object.Method(argument) -> defaultTranslator

TranslateInlineQueryOfT ( ObjectQuery inlineQuery ) : DbExpression
TranslateIntoCanonicalFunction ( string functionName, Expression Expression ) : DbFunctionExpression

Translates the arguments into DbExpressions and creates a canonical function with the given functionName and these arguments

TranslateLambda ( LambdaExpression lambda, DbExpression input ) : DbExpression
TranslateLambda ( LambdaExpression lambda, DbExpression input, System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding &binding ) : DbExpression
TranslateLambda ( LambdaExpression lambda, DbExpression input, System.Data.Entity.Core.Common.CommandTrees.DbGroupExpressionBinding &binding ) : DbExpression
TranslateLambda ( LambdaExpression lambda, DbExpression input, string bindingName, System.Data.Entity.Core.Common.CommandTrees.DbExpressionBinding &binding ) : DbExpression
TranslateLike ( MethodCallExpression call ) : DbExpression

Helper method for String.Like object.Like(likeExpression[, escapeCharacter]) is translated to: object like likeExpression [escape escapeCharacter]

TranslateSet ( Expression linq ) : DbExpression
TryGetSpan ( DbExpression expression, Span &span ) : bool

Attempts to retrieve Span information for the specified DbExpression.

TryGetValueLayerType ( Type linqType, TypeUsage &type ) : bool
TypeUsageEquals ( TypeUsage left, TypeUsage right ) : bool
UnifySpanMappings ( DbExpression left, DbExpression right, DbExpression to ) : void

Unifies the Span information from the specified left and right expressions, and applies it to the specified to expression. Unification proceeds as follows: - If neither left nor right have Span information, no changes are made - If one of left or right has Span information, that single Span information entry is removed from the Span mapping dictionary and used to create a new entry that maps from the expression to the Span information. - If both left and right have Span information, both entries are removed from the Span mapping dictionary, a new Span is created that contains the union of the original Spans, and a new entry is added to the dictionary that maps from to expression to this new Span.

UnionAll ( DbExpression left, DbExpression right ) : DbUnionAllExpression
ValidateAndAdjustCastTypes ( TypeUsage toType, TypeUsage fromType, Type toClrType, Type fromClrType ) : TypeUsage

Check that the given cast specification is supported and if necessary adjust target type (for instance add precision and scale for Integral -> Decimal casts)

ValidateInitializerMetadata ( InitializerMetadata metadata ) : void
VerifyRowTypeSupportedForComparison ( Type clrType, System.Data.Entity.Core.Metadata.Edm.RowType rowType, Stack memberPath, bool isNullComparison ) : void
VerifyTypeSupportedForComparison ( Type clrType, TypeUsage edmType, Stack memberPath, bool isNullComparison ) : void

Utility method validating type for comparison ops (isNull, equals, etc.). Only primitive types, entity types, and simple row types (no IGrouping/EntityCollection) are supported.