Class PersistChangesHandler
A persist changes handler.
Inheritance
Inherited Members
Namespace: Kephas.Data.Endpoints
Assembly: Kephas.Data.Endpoints.dll
Syntax
public class PersistChangesHandler : MessageHandlerBase<PersistChangesMessage, PersistChangesResponseMessage>, ILoggable, IMessageHandler<PersistChangesMessage>, IMessageHandler, IDisposable
Constructors
| Improve this Doc View SourcePersistChangesHandler(IDataConversionService, IProjectedTypeResolver, IExportFactory<IDataSpace>)
Initializes a new instance of the PersistChangesHandler class.
Declaration
public PersistChangesHandler(IDataConversionService dataConversionService, IProjectedTypeResolver projectedTypeResolver, IExportFactory<IDataSpace> dataSpaceFactory)
Parameters
Type | Name | Description |
---|---|---|
IDataConversionService | dataConversionService | The data conversion service. |
IProjectedTypeResolver | projectedTypeResolver | The projected type resolver. |
IExportFactory<IDataSpace> | dataSpaceFactory | The data space factory. |
Methods
| Improve this Doc View SourceCreateDataConversionContextForResponse(IDataSpace)
Creates data conversion context for response.
Declaration
protected virtual IDataConversionContext CreateDataConversionContextForResponse(IDataSpace dataSpace)
Parameters
Type | Name | Description |
---|---|---|
IDataSpace | dataSpace | Manager for data context. |
Returns
Type | Description |
---|---|
IDataConversionContext | The new data conversion context for response. |
GetClientTypeName(Object)
Gets the type name of the client entity.
Declaration
protected virtual string GetClientTypeName(object clientEntity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clientEntity | The client entity. |
Returns
Type | Description |
---|---|
System.String | The deleted entity. |
PostPersistChangesAsync(PersistChangesResponseMessage, IList<(DtoEntityEntry dtoEntityEntry, Object entity)>, IDataSpace, CancellationToken)
Post persist changes asynchronously.
Declaration
protected virtual Task PostPersistChangesAsync(PersistChangesResponseMessage response, IList<(DtoEntityEntry dtoEntityEntry, object entity)> mappings, IDataSpace dataSpace, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PersistChangesResponseMessage | response | The response. |
System.Collections.Generic.IList<System.ValueTuple<DtoEntityEntry, System.Object>> | mappings | The mappings. |
IDataSpace | dataSpace | Manager for data context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
PrePersistChangesAsync(PersistChangesResponseMessage, IList<(DtoEntityEntry clientEntry, Object entity)>, IDataSpace, CancellationToken)
Pre persist changes asynchronously.
Declaration
protected virtual Task PrePersistChangesAsync(PersistChangesResponseMessage response, IList<(DtoEntityEntry clientEntry, object entity)> mappings, IDataSpace dataSpace, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
PersistChangesResponseMessage | response | The response. |
System.Collections.Generic.IList<System.ValueTuple<DtoEntityEntry, System.Object>> | mappings | The mappings. |
IDataSpace | dataSpace | Manager for data context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task. |
ProcessAsync(PersistChangesMessage, IMessagingContext, CancellationToken)
Processes the provided message asynchronously and returns a response promise.
Declaration
public override Task<PersistChangesResponseMessage> ProcessAsync(PersistChangesMessage message, IMessagingContext context, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
PersistChangesMessage | message | The message to be handled. |
IMessagingContext | context | The processing context. |
System.Threading.CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PersistChangesResponseMessage> | The response promise. |