Class DefaultClientQueryConverter
A default client query converter.
Inherited Members
Namespace: Kephas.Data.Client.Queries.Conversion
Assembly: Kephas.Data.Client.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultClientQueryConverter : Loggable, ILoggable, IClientQueryConverter
Constructors
| Improve this Doc View SourceDefaultClientQueryConverter(ITypeResolver, IProjectedTypeResolver, ICollection<IExportFactory<IExpressionConverter, ExpressionConverterMetadata>>)
Initializes a new instance of the DefaultClientQueryConverter class.
Declaration
public DefaultClientQueryConverter(ITypeResolver typeResolver, IProjectedTypeResolver projectedTypeResolver, ICollection<IExportFactory<IExpressionConverter, ExpressionConverterMetadata>> converterFactories)
Parameters
Type | Name | Description |
---|---|---|
ITypeResolver | typeResolver | The type resolver. |
IProjectedTypeResolver | projectedTypeResolver | The entity type resolver. |
System.Collections.Generic.ICollection<IExportFactory<IExpressionConverter, ExpressionConverterMetadata>> | converterFactories | The expression converters. |
Methods
| Improve this Doc View SourceConvertExpression(Expression, Type, ParameterExpression, IClientQueryConversionContext)
Converts the provided client expression to a LINQ expression.
Declaration
protected virtual Expression ConvertExpression(Expression expression, Type clientItemType, ParameterExpression lambdaArg, IClientQueryConversionContext context)
Parameters
Type | Name | Description |
---|---|---|
Expression | expression | The expression. |
System.Type | clientItemType | The client item type. |
System.Linq.Expressions.ParameterExpression | lambdaArg | The lambda argument. |
IClientQueryConversionContext | context | The query conversion context. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | The converted LINQ expression. |
ConvertFilter(Type, Type, Expression, IClientQueryConversionContext)
Converts the where clause.
Declaration
protected virtual Expression ConvertFilter(Type itemType, Type clientItemType, Expression where, IClientQueryConversionContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Type | itemType | The item type. |
System.Type | clientItemType | The client item type. |
Expression | where | The where clause. |
IClientQueryConversionContext | context | The query conversion context. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | The converted where clause. |
ConvertOrder(Type, Type, Expression, IClientQueryConversionContext)
Converts the order clause.
Declaration
protected virtual IEnumerable<(string op, Expression expression)> ConvertOrder(Type itemType, Type clientItemType, Expression order, IClientQueryConversionContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Type | itemType | The item type. |
System.Type | clientItemType | The client item type. |
Expression | order | The order clause. |
IClientQueryConversionContext | context | The query conversion context. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ValueTuple<System.String, System.Linq.Expressions.Expression>> | The converted order clause. |
ConvertQuery(ClientQuery, IClientQueryConversionContext)
Converts the provided client query to a queryable which can be executed.
Declaration
public virtual IQueryable ConvertQuery(ClientQuery clientQuery, IClientQueryConversionContext context)
Parameters
Type | Name | Description |
---|---|---|
ClientQuery | clientQuery | The client query. |
IClientQueryConversionContext | context | The query conversion context. |
Returns
Type | Description |
---|---|
System.Linq.IQueryable | The converted query. |
CreateQuery(Type, IClientQueryConversionContext)
Creates the query.
Declaration
protected virtual IQueryable CreateQuery(Type entityType, IClientQueryConversionContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Type | entityType | The entity type. |
IClientQueryConversionContext | context | The query conversion context. |
Returns
Type | Description |
---|---|
System.Linq.IQueryable | The new query. |
GetQueryClientEntityType(ClientQuery)
Gets the query client entity type.
Declaration
protected virtual Type GetQueryClientEntityType(ClientQuery clientQuery)
Parameters
Type | Name | Description |
---|---|---|
ClientQuery | clientQuery | The client query. |
Returns
Type | Description |
---|---|
System.Type | The query client entity type. |
GetQueryEntityType(ClientQuery, Type)
Gets the query entity type based on the client entity type.
Declaration
protected virtual Type GetQueryEntityType(ClientQuery clientQuery, Type clientEntityType)
Parameters
Type | Name | Description |
---|---|---|
ClientQuery | clientQuery | The client query. |
System.Type | clientEntityType | The client entity type. |
Returns
Type | Description |
---|---|
System.Type | The query entity type. |
MakeConstantExpression(Object)
Makes a constant expression out of the provided argument.
Declaration
protected virtual Expression MakeConstantExpression(object arg)
Parameters
Type | Name | Description |
---|---|---|
System.Object | arg | The argument. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | A LINQ expression. |