Show / Hide Table of Contents

Class PersistChangesCommand

Base class for commands which persist dataContext changes.

Inheritance
System.Object
Loggable
DataCommandBase<IPersistChangesContext, IDataCommandResult>
PersistChangesCommand
DtoPersistChangesCommand
LLBLGenPersistChangesCommand
MongoPersistChangesCommand
Implements
ILoggable
IPersistChangesCommand
IDataCommand<IPersistChangesContext, IDataCommandResult>
IDataCommand
IAsyncOperation
Inherited Members
DataCommandBase<IPersistChangesContext, IDataCommandResult>.ExecuteAsync(IPersistChangesContext, CancellationToken)
DataCommandBase<IPersistChangesContext, IDataCommandResult>.IDataCommand.ExecuteAsync(IDataOperationContext, CancellationToken)
DataCommandBase<IPersistChangesContext, IDataCommandResult>.IAsyncOperation.ExecuteAsync(IContext, CancellationToken)
DataCommandBase<IPersistChangesContext, IDataCommandResult>.GetIdEqualityExpression<T>(IDataContext, Object)
DataCommandBase<IPersistChangesContext, IDataCommandResult>.TryGetLocalCache(IDataContext)
DataCommandBase<IPersistChangesContext, IDataCommandResult>.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
[DataContextType(typeof(DataContextBase))]
public class PersistChangesCommand : DataCommandBase<IPersistChangesContext, IDataCommandResult>, ILoggable, IPersistChangesCommand, IDataCommand<IPersistChangesContext, IDataCommandResult>, IDataCommand, IAsyncOperation

Constructors

| Improve this Doc View Source

PersistChangesCommand(IDataBehaviorProvider)

Initializes a new instance of the PersistChangesCommand class.

Declaration
public PersistChangesCommand(IDataBehaviorProvider behaviorProvider)
Parameters
Type Name Description
IDataBehaviorProvider behaviorProvider

The behavior provider.

Properties

| Improve this Doc View Source

BehaviorProvider

Gets the behavior provider.

Declaration
public IDataBehaviorProvider BehaviorProvider { get; }
Property Value
Type Description
IDataBehaviorProvider

The behavior provider.

Methods

| Improve this Doc View Source

AcceptChanges(IPersistChangesContext, IList<IEntityEntry>)

Accepts the changes of the entities after the persistance.

Declaration
protected virtual void AcceptChanges(IPersistChangesContext operationContext, IList<IEntityEntry> changeSet)
Parameters
Type Name Description
IPersistChangesContext operationContext

The operation context.

System.Collections.Generic.IList<IEntityEntry> changeSet

The change set.

| Improve this Doc View Source

ApplyAfterPersistBehaviorsAsync(IPersistChangesContext, IList<IEntityEntry>, CancellationToken)

Applies the behaviors invoking the AfterPersistAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken) asynchronously.

Declaration
protected virtual Task ApplyAfterPersistBehaviorsAsync(IPersistChangesContext operationContext, IList<IEntityEntry> changeSet, CancellationToken cancellationToken)
Parameters
Type Name Description
IPersistChangesContext operationContext

The operation context for persisting the changes.

System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

ApplyBeforePersistBehaviorsAsync(IPersistChangesContext, IList<IEntityEntry>, CancellationToken)

Applies the behaviors invoking the BeforePersistAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken) asynchronously.

Declaration
protected virtual Task ApplyBeforePersistBehaviorsAsync(IPersistChangesContext operationContext, IList<IEntityEntry> changeSet, CancellationToken cancellationToken)
Parameters
Type Name Description
IPersistChangesContext operationContext

The operation context for persisting the changes.

System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

ComputeIterationChangeSet(IPersistChangesContext)

Computes the change set for the current iteration and returns it.

Declaration
protected virtual IList<IEntityEntry> ComputeIterationChangeSet(IPersistChangesContext operationContext)
Parameters
Type Name Description
IPersistChangesContext operationContext

The operation context.

Returns
Type Description
System.Collections.Generic.IList<IEntityEntry>

A list of modified IEntityEntry objects.

| Improve this Doc View Source

ExecuteAsync(IPersistChangesContext, CancellationToken)

Executes the data command asynchronously.

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

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A promise of a IDataCommandResult.

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

PersistChangeSetAsync(IList<IEntityEntry>, IPersistChangesContext, CancellationToken)

Persists the entities in the change set asynchronously.

Declaration
protected virtual Task PersistChangeSetAsync(IList<IEntityEntry> changeSet, IPersistChangesContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

IPersistChangesContext operationContext

The data operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

PostProcessChangeSetAsync(IList<IEntityEntry>, IPersistChangesContext, CancellationToken)

Post processes the change set asynchronously.

Declaration
protected virtual Task PostProcessChangeSetAsync(IList<IEntityEntry> changeSet, IPersistChangesContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

IPersistChangesContext operationContext

The data operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

PreProcessChangeSetAsync(IList<IEntityEntry>, IPersistChangesContext, CancellationToken)

Pre processes the change set asynchronously.

Declaration
protected virtual Task PreProcessChangeSetAsync(IList<IEntityEntry> changeSet, IPersistChangesContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

IPersistChangesContext operationContext

The data operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

Remarks

By default, it sets the PrePersistChangeState to be equal to ChangeState.

| Improve this Doc View Source

ValidateAndPersistChangeSetAsync(IList<IEntityEntry>, Int32, IPersistChangesContext, StringBuilder, CancellationToken)

Validates and persists the modified entities.

Declaration
protected virtual Task<int> ValidateAndPersistChangeSetAsync(IList<IEntityEntry> changeSet, int changes, IPersistChangesContext operationContext, StringBuilder sb, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Collections.Generic.IList<IEntityEntry> changeSet

The change set.

System.Int32 changes

The changes.

IPersistChangesContext operationContext

The data operation context.

System.Text.StringBuilder sb

The string builder to append logging data.

System.Threading.CancellationToken cancellationToken

The cancellation token.

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

The aggregated number of changes.

| Improve this Doc View Source

ValidateChangeSetAsync(IList<IEntityEntry>, IPersistChangesContext, CancellationToken)

Validates the modified entries asynchronously.

Declaration
protected virtual Task ValidateChangeSetAsync(IList<IEntityEntry> changeSet, IPersistChangesContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Collections.Generic.IList<IEntityEntry> changeSet

The modified entities.

IPersistChangesContext operationContext

The data operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

ValidateEntityAsync(Object, IEntityEntry, IPersistChangesContext, CancellationToken)

Validates the modified entity asynchronously.

Declaration
protected virtual Task<IDataValidationResult> ValidateEntityAsync(object entityPart, IEntityEntry entityPartEntry, IPersistChangesContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object entityPart

The entity part.

IEntityEntry entityPartEntry

Information describing the entity part.

IPersistChangesContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A System.Threading.Tasks.Task<TResult>.

Implements

ILoggable
IPersistChangesCommand
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