Show / Hide Table of Contents

Class DataBehaviorBase<TEntity>

An entity behavior base.

Inheritance
System.Object
Loggable
DataBehaviorBase<TEntity>
DataAnnotationsBehaviorBase<TEntity>
LLBLGenDeleteEntityBehavior
LLBLGenPersistEntityBehavior
LLBLGenRefBehavior
Implements
ILoggable
IDataBehavior<TEntity>
IDataBehavior
IOnPersistBehavior
IOnInitializeBehavior
IOnValidateBehavior
Inherited Members
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.Behaviors
Assembly: Kephas.Data.dll
Syntax
public abstract class DataBehaviorBase<TEntity> : Loggable, ILoggable, IDataBehavior<TEntity>, IDataBehavior, IOnPersistBehavior, IOnInitializeBehavior, IOnValidateBehavior
Type Parameters
Name Description
TEntity

Type of the entity.

Methods

| Improve this Doc View Source

AfterPersist(TEntity, IEntityEntry, IDataOperationContext)

Callback invoked after an entity has been persisted.

Declaration
public virtual void AfterPersist(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext)
Parameters
Type Name Description
TEntity entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

| Improve this Doc View Source

AfterPersistAsync(TEntity, IEntityEntry, IDataOperationContext, CancellationToken)

Callback invoked after an entity was persisted.

Declaration
public virtual Task AfterPersistAsync(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
TEntity entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

BeforePersist(TEntity, IEntityEntry, IDataOperationContext)

Callback invoked before an entity is being persisted.

Declaration
public virtual void BeforePersist(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext)
Parameters
Type Name Description
TEntity entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

| Improve this Doc View Source

BeforePersistAsync(TEntity, IEntityEntry, IDataOperationContext, CancellationToken)

Callback invoked before an entity is being persisted.

Declaration
public virtual Task BeforePersistAsync(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
TEntity entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

Initialize(TEntity, IEntityEntry, IDataOperationContext)

Callback invoked upon entity initialization.

Declaration
public virtual void Initialize(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext)
Parameters
Type Name Description
TEntity entity

The entitiy to be initialized.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

| Improve this Doc View Source

InitializeAsync(TEntity, IEntityEntry, IDataOperationContext, CancellationToken)

Initializes the entity asynchronously.

Declaration
public virtual Task InitializeAsync(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
TEntity entity

The entitiy to be initialized.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

Validate(TEntity, IEntityEntry, IDataOperationContext)

Callback invoked after upon entity validation.

Declaration
public virtual IDataValidationResult Validate(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext)
Parameters
Type Name Description
TEntity entity

The entity.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

Returns
Type Description
IDataValidationResult

An IDataValidationResult.

| Improve this Doc View Source

ValidateAsync(TEntity, IEntityEntry, IDataOperationContext, CancellationToken)

Validates the provided instance asynchronously.

Declaration
public virtual Task<IDataValidationResult> ValidateAsync(TEntity entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
TEntity entity

The entity to be validated.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

Context for the validation operation.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A promise of a IDataValidationResult.

Explicit Interface Implementations

| Improve this Doc View Source

IOnInitializeBehavior.InitializeAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken)

Initializes the entity asynchronously.

Declaration
Task IOnInitializeBehavior.InitializeAsync(object entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object entity

The entitiy to be initialized.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

IOnPersistBehavior.AfterPersistAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken)

Callback invoked after an entity was persisted.

Declaration
Task IOnPersistBehavior.AfterPersistAsync(object entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

IOnPersistBehavior.BeforePersistAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken)

Callback invoked before an entity is being persisted.

Declaration
Task IOnPersistBehavior.BeforePersistAsync(object entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object entity

The entity to be persisted.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

The operation context.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task

A Task.

| Improve this Doc View Source

IOnValidateBehavior.ValidateAsync(Object, IEntityEntry, IDataOperationContext, CancellationToken)

Validates the provided instance asynchronously.

Declaration
Task<IDataValidationResult> IOnValidateBehavior.ValidateAsync(object entity, IEntityEntry entityEntry, IDataOperationContext operationContext, CancellationToken cancellationToken)
Parameters
Type Name Description
System.Object entity

The entity to be validated.

IEntityEntry entityEntry

The entity entry.

IDataOperationContext operationContext

Context for the validation operation.

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

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

A promise of a IDataValidationResult.

Implements

ILoggable
IDataBehavior<TEntity>
IDataBehavior
IOnPersistBehavior
IOnInitializeBehavior
IOnValidateBehavior

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