Show / Hide Table of Contents

Class FindCommandBase<TFindContext>

Base class for find commands.

Inheritance
System.Object
Loggable
DataCommandBase<TFindContext, IFindResult>
FindCommandBase<TFindContext>
FindCommand
FindOneCommand
Implements
ILoggable
IDataCommand<TFindContext, IFindResult>
IDataCommand
IAsyncOperation
Inherited Members
DataCommandBase<TFindContext, IFindResult>.ExecuteAsync(TFindContext, CancellationToken)
DataCommandBase<TFindContext, IFindResult>.IDataCommand.ExecuteAsync(IDataOperationContext, CancellationToken)
DataCommandBase<TFindContext, IFindResult>.IAsyncOperation.ExecuteAsync(IContext, CancellationToken)
DataCommandBase<TFindContext, IFindResult>.GetIdEqualityExpression<T>(IDataContext, Object)
DataCommandBase<TFindContext, IFindResult>.TryGetLocalCache(IDataContext)
DataCommandBase<TFindContext, IFindResult>.TryGetEntityActivator(IDataContext)
Loggable.Logger
Loggable.GetLogger()
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.Commands
Assembly: Kephas.Data.dll
Syntax
public abstract class FindCommandBase<TFindContext> : DataCommandBase<TFindContext, IFindResult>, ILoggable, IDataCommand<TFindContext, IFindResult>, IDataCommand, IAsyncOperation where TFindContext : class, IFindContextBase
Type Parameters
Name Description
TFindContext

Type of the find context.

Methods

| Improve this Doc View Source

ExecuteAsync(TFindContext, CancellationToken)

Executes the data command asynchronously.

Declaration
public override Task<IFindResult> ExecuteAsync(TFindContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
TFindContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A promise of a IDataCommandResult.

Overrides
Kephas.Data.Commands.DataCommandBase<TFindContext, Kephas.Data.Commands.IFindResult>.ExecuteAsync(TFindContext, System.Threading.CancellationToken)
| Improve this Doc View Source

FindAsync<T>(TFindContext, CancellationToken)

Searches for the first entity matching the provided criteria and returns it asynchronously.

Declaration
protected virtual Task<IFindResult> FindAsync<T>(TFindContext findContext, CancellationToken cancellationToken)

    where T : class
Parameters
Type Name Description
TFindContext findContext

The find context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A promise of the found entity.

Type Parameters
Name Description
T

The type of the entity.

| Improve this Doc View Source

GetCriteriaString<T>(TFindContext, Expression<Func<T, Boolean>>)

Gets the criteria string for exception display.

Declaration
protected virtual string GetCriteriaString<T>(TFindContext findContext, Expression<Func<T, bool>> criteria)
Parameters
Type Name Description
TFindContext findContext

The find context.

System.Linq.Expressions.Expression<System.Func<T, System.Boolean>> criteria

The criteria.

Returns
Type Description
System.String

The criteria string.

Type Parameters
Name Description
T

The entity type.

| Improve this Doc View Source

GetFindCriteria<T>(TFindContext)

Gets the find criteria.

Declaration
protected abstract Expression<Func<T, bool>> GetFindCriteria<T>(TFindContext findContext)

    where T : class
Parameters
Type Name Description
TFindContext findContext

The find context.

Returns
Type Description
System.Linq.Expressions.Expression<System.Func<T, System.Boolean>>

The find criteria.

Type Parameters
Name Description
T

The entity type.

| Improve this Doc View Source

GetFindResult<T>(TFindContext, IList<T>, Expression<Func<T, Boolean>>)

Gets the find result out of the results.

Declaration
protected virtual IFindResult GetFindResult<T>(TFindContext findContext, IList<T> result, Expression<Func<T, bool>> criteria)

    where T : class
Parameters
Type Name Description
TFindContext findContext

The find context.

System.Collections.Generic.IList<T> result

The result.

System.Linq.Expressions.Expression<System.Func<T, System.Boolean>> criteria

The criteria.

Returns
Type Description
IFindResult

The find result.

Type Parameters
Name Description
T

The entity type.

| Improve this Doc View Source

TryGetLocalCacheQuery<T>(TFindContext)

Tries to get a query over the local cache entities of a particular type.

Declaration
protected virtual IEnumerable<T> TryGetLocalCacheQuery<T>(TFindContext findContext)

    where T : class
Parameters
Type Name Description
TFindContext findContext

The find context.

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

A query of local cache entities.

Type Parameters
Name Description
T

The entity type.

Implements

ILoggable
IDataCommand<TOperationContext, TResult>
IDataCommand
IAsyncOperation

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