Show / Hide Table of Contents

Class DataContextQueryProvider

A data context query provider base.

Inheritance
System.Object
DataContextQueryProvider
LLBLGenQueryProvider
MongoQueryProvider
Implements
IDataContextQueryProvider
IAsyncQueryProvider
System.Linq.IQueryProvider
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Data.Linq
Assembly: Kephas.Data.dll
Syntax
public class DataContextQueryProvider : IDataContextQueryProvider, IAsyncQueryProvider, IQueryProvider

Constructors

| Improve this Doc View Source

DataContextQueryProvider(IQueryOperationContext, IQueryProvider)

Initializes a new instance of the DataContextQueryProvider class.

Declaration
public DataContextQueryProvider(IQueryOperationContext queryOperationContext, IQueryProvider nativeQueryProvider)
Parameters
Type Name Description
IQueryOperationContext queryOperationContext

The query operation context.

System.Linq.IQueryProvider nativeQueryProvider

The native query provider.

Properties

| Improve this Doc View Source

DataContext

Gets the bound data context.

Declaration
public IDataContext DataContext { get; }
Property Value
Type Description
IDataContext

The bound data context.

| Improve this Doc View Source

NativeQueryProvider

Gets the native query provider.

Declaration
public IQueryProvider NativeQueryProvider { get; }
Property Value
Type Description
System.Linq.IQueryProvider

The native query provider.

| Improve this Doc View Source

QueryOperationContext

Gets an operation context for the query.

Declaration
public IQueryOperationContext QueryOperationContext { get; }
Property Value
Type Description
IQueryOperationContext

The query operation context.

Methods

| Improve this Doc View Source

AttachEntitiesToDataContext<TResult>(TResult)

Attach entities to data context.

Declaration
protected virtual TResult AttachEntitiesToDataContext<TResult>(TResult executionResult)
Parameters
Type Name Description
TResult executionResult

The execution result.

Returns
Type Description
TResult

The result containing attached entities.

Type Parameters
Name Description
TResult

The type of the value that results from executing the query.

| Improve this Doc View Source

AttachEntityCollection<TResult, T>(TResult)

Attaches an entity collection.

Declaration
protected TResult AttachEntityCollection<TResult, T>(TResult executionResult)

    where TResult : IEnumerable<T>
Parameters
Type Name Description
TResult executionResult

The execution result.

Returns
Type Description
TResult

A list of attached entities.

Type Parameters
Name Description
TResult

Type of the result.

T

The entity type.

| Improve this Doc View Source

CreateQuery(Expression)

Constructs an System.Linq.IQueryable object that can evaluate the query represented by a specified expression tree.

Declaration
public virtual IQueryable CreateQuery(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

Returns
Type Description
System.Linq.IQueryable

An System.Linq.IQueryable that can evaluate the query represented by the specified expression tree.

| Improve this Doc View Source

CreateQuery<TElement>(Expression)

Constructs an System.Linq.IQueryable<T> object that can evaluate the query represented by a specified expression tree.

Declaration
public virtual IQueryable<TElement> CreateQuery<TElement>(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

Returns
Type Description
System.Linq.IQueryable<TElement>

An System.Linq.IQueryable<T> that can evaluate the query represented by the specified expression tree.

Type Parameters
Name Description
TElement

The type of the elements of the System.Linq.IQueryable<T> that is returned.

| Improve this Doc View Source

CreateQuery<TElement>(IQueryable<TElement>)

Constructs an System.Linq.IQueryable object that can evaluate the query represented by a specified expression tree.

Declaration
protected virtual IQueryable<TElement> CreateQuery<TElement>(IQueryable<TElement> nativeQuery)
Parameters
Type Name Description
System.Linq.IQueryable<TElement> nativeQuery

The native query.

Returns
Type Description
System.Linq.IQueryable<TElement>

An System.Linq.IQueryable that can evaluate the query represented by the specified expression tree.

Type Parameters
Name Description
TElement

The query element type.

| Improve this Doc View Source

CreateQueryExpressionVisitor(Func<Type, IContext, Type>, IActivator)

Creates an expression visitor used to visit the query expression.

Declaration
protected virtual ExpressionVisitor CreateQueryExpressionVisitor(Func<Type, IContext, Type> implementationTypeResolver, IActivator activator)
Parameters
Type Name Description
System.Func<System.Type, IContext, System.Type> implementationTypeResolver

The implementation type resolver.

IActivator activator

The activator.

Returns
Type Description
System.Linq.Expressions.ExpressionVisitor

The new query expression visitor.

| Improve this Doc View Source

Execute(Expression)

Executes the query represented by a specified expression tree.

Declaration
public virtual object Execute(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

Returns
Type Description
System.Object

The value that results from executing the specified query.

| Improve this Doc View Source

Execute<TResult>(Expression)

Executes the strongly-typed query represented by a specified expression tree.

Declaration
public virtual TResult Execute<TResult>(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

Returns
Type Description
TResult

The value that results from executing the specified query.

Type Parameters
Name Description
TResult

The type of the value that results from executing the query.

| Improve this Doc View Source

ExecuteAsync(Expression, CancellationToken)

Asynchronously executes the query represented by a specified expression tree.

Declaration
public virtual Task<object> ExecuteAsync(Expression expression, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
Type Description
System.Threading.Tasks.Task<System.Object>

A task that represents the asynchronous operation. The task result contains the value that results from executing the specified query.

| Improve this Doc View Source

ExecuteAsync<TResult>(Expression, CancellationToken)

Asynchronously executes the strongly-typed query represented by a specified expression tree.

Declaration
public virtual Task<TResult> ExecuteAsync<TResult>(Expression expression, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
Type Description
System.Threading.Tasks.Task<TResult>

A task that represents the asynchronous operation. The task result contains the value that results from executing the specified query.

Type Parameters
Name Description
TResult

The type of the value that results from executing the query.

| Improve this Doc View Source

GetExecutableExpression(Expression)

Prepares the provided expression for execution.

Declaration
protected virtual Expression GetExecutableExpression(Expression expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression expression

An expression tree that represents a LINQ query.

Returns
Type Description
System.Linq.Expressions.Expression

An expression prepared for execution.

| Improve this Doc View Source

IsAttachable(Object)

Indicates whether an entity is attachable.

Declaration
protected virtual bool IsAttachable(object entity)
Parameters
Type Name Description
System.Object entity

The entity.

Returns
Type Description
System.Boolean

True if the entity is attachable, false if not.

| Improve this Doc View Source

IsAttachableType(Type)

Indicates whether an entity type is attachable.

Declaration
protected virtual bool IsAttachableType(Type entityType)
Parameters
Type Name Description
System.Type entityType

The entity type.

Returns
Type Description
System.Boolean

True if the entity type is attachable, false if not.

| Improve this Doc View Source

ToExecutionResult<TResult, T>(IList<T>)

Converts the list of attached entities to an execution result.

Declaration
protected virtual TResult ToExecutionResult<TResult, T>(IList<T> attachedList)

    where TResult : IEnumerable<T>
Parameters
Type Name Description
System.Collections.Generic.IList<T> attachedList

List of attached entities.

Returns
Type Description
TResult

The attached entity list as a TResult.

Type Parameters
Name Description
TResult

Type of the result.

T

The item type.

| Improve this Doc View Source

TryGetEntityActivator()

Tries to get the data context's entity activator.

Declaration
protected virtual IActivator TryGetEntityActivator()
Returns
Type Description
IActivator

An IActivator.

Implements

IDataContextQueryProvider
IAsyncQueryProvider
System.Linq.IQueryProvider

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX