Table of Contents

Class ApizrCrudMediator

Namespace
Apizr.Mediation.Cruding.Sending
Assembly
Apizr.Integrations.MediatR.dll

Apizr mediator dedicated to cruding

public class ApizrCrudMediator : ApizrMediatorBase, IApizrCrudMediator, IApizrCrudMediatorBase, IApizrMediatorBase
Inheritance
ApizrCrudMediator
Implements
Inherited Members

Constructors

ApizrCrudMediator(IMediator)

public ApizrCrudMediator(IMediator mediator)

Parameters

mediator IMediator

Methods

SendCreateCommand<TApiEntity>(TApiEntity, Action<IApizrRequestOptionsBuilder>)

Send a CreateCommand<TModelData> to Apizr using MediatR

public Task<TApiEntity> SendCreateCommand<TApiEntity>(TApiEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TApiEntity

The entity to create

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TApiEntity>

Type Parameters

TApiEntity

The api entity type

SendCreateCommand<TModelEntity, TApiEntity>(TModelEntity, Action<IApizrRequestOptionsBuilder>)

Send a mapped CreateCommand<TModelData> to Apizr using MediatR returning a mapped result

public Task<TModelEntity> SendCreateCommand<TModelEntity, TApiEntity>(TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TModelEntity

The entity to create

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TModelEntity>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

SendDeleteCommand<TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a DeleteCommand<T, TKey> to Apizr using MediatR

public Task SendDeleteCommand<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendReadAllQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder>)

Send a ReadAllQuery<TReadAllResult> to Apizr using MediatR

public Task<TReadAllResult> SendReadAllQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TReadAllResult>

Type Parameters

TReadAllResult

The "ReadAll" query result type

SendReadAllQuery<TModelReadAllResult, TReadAllResult>(Action<IApizrRequestOptionsBuilder>)

Send a mapped ReadAllQuery<TReadAllResult> to Apizr using MediatR returning mapped result

public Task<TModelReadAllResult> SendReadAllQuery<TModelReadAllResult, TReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TModelReadAllResult>

Type Parameters

TModelReadAllResult

The model result type to map to

TReadAllResult

SendReadAllQuery<TReadAllResult, TReadAllParams>(TReadAllParams, Action<IApizrRequestOptionsBuilder>)

Send a ReadAllQuery<TReadAllResult> to Apizr using MediatR

public Task<TReadAllResult> SendReadAllQuery<TReadAllResult, TReadAllParams>(TReadAllParams readAllParams, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

readAllParams TReadAllParams

The read all filters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TReadAllResult>

Type Parameters

TReadAllResult

The api result type

TReadAllParams

The ReadAll parameters type

SendReadAllQuery<TModelReadAllResult, TReadAllResult, TReadAllParams>(TReadAllParams, Action<IApizrRequestOptionsBuilder>)

Send a mapped ReadAllQuery<TReadAllResult> to Apizr using MediatR returning a mapped result

public Task<TModelReadAllResult> SendReadAllQuery<TModelReadAllResult, TReadAllResult, TReadAllParams>(TReadAllParams readAllParams, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

readAllParams TReadAllParams

The read all filters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TModelReadAllResult>

Type Parameters

TModelReadAllResult

The model result type to map to

TReadAllResult
TReadAllParams

The ReadAll parameters type

SendReadQuery<TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a ReadQuery<TResultData, TKey> to Apizr using MediatR

public Task<TApiEntity> SendReadQuery<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TApiEntity>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendReadQuery<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a ReadQuery<TResultData, TKey> to Apizr using MediatR returning a mapped result

public Task<TModelEntity> SendReadQuery<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<TModelEntity>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

TApiEntityKey

The entity's crud key type

SendSafeCreateCommand<TApiEntity>(TApiEntity, Action<IApizrRequestOptionsBuilder>)

Send a SafeCreateCommand<TModelData> to Apizr using MediatR

public Task<IApizrResponse<TApiEntity>> SendSafeCreateCommand<TApiEntity>(TApiEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TApiEntity

The entity to create

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TApiEntity>>

Type Parameters

TApiEntity

The api entity type

SendSafeCreateCommand<TModelEntity, TApiEntity>(TModelEntity, Action<IApizrRequestOptionsBuilder>)

Send a mapped SafeCreateCommand<TModelData> to Apizr using MediatR returning a mapped result

public Task<IApizrResponse<TModelEntity>> SendSafeCreateCommand<TModelEntity, TApiEntity>(TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TModelEntity

The entity to create

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TModelEntity>>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

SendSafeDeleteCommand<TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a SafeDeleteCommand<T, TKey> to Apizr using MediatR

public Task<IApizrResponse> SendSafeDeleteCommand<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendSafeReadAllQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder>)

Send a SafeReadAllQuery<TReadAllResult> to Apizr using MediatR

public Task<IApizrResponse<TReadAllResult>> SendSafeReadAllQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TReadAllResult>>

Type Parameters

TReadAllResult

The "ReadAll" query result type

SendSafeReadAllQuery<TModelReadAllResult, TApiReadAllResult>(Action<IApizrRequestOptionsBuilder>)

Send a mapped SafeReadAllQuery<TReadAllResult> to Apizr using MediatR returning mapped result

public Task<IApizrResponse<TModelReadAllResult>> SendSafeReadAllQuery<TModelReadAllResult, TApiReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TModelReadAllResult>>

Type Parameters

TModelReadAllResult

The model result type to map to

TApiReadAllResult

The api result type to map from

SendSafeReadAllQuery<TReadAllResult, TReadAllParams>(TReadAllParams, Action<IApizrRequestOptionsBuilder>)

Send a SafeReadAllQuery<TReadAllResult> to Apizr using MediatR

public Task<IApizrResponse<TReadAllResult>> SendSafeReadAllQuery<TReadAllResult, TReadAllParams>(TReadAllParams readAllParams, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

readAllParams TReadAllParams

The read all filters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TReadAllResult>>

Type Parameters

TReadAllResult

The api result type

TReadAllParams

The ReadAll parameters type

SendSafeReadAllQuery<TModelReadAllResult, TApiReadAllResult, TReadAllParams>(TReadAllParams, Action<IApizrRequestOptionsBuilder>)

Send a mapped SafeReadAllQuery<TReadAllResult> to Apizr using MediatR returning a mapped result

public Task<IApizrResponse<TModelReadAllResult>> SendSafeReadAllQuery<TModelReadAllResult, TApiReadAllResult, TReadAllParams>(TReadAllParams readAllParams, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

readAllParams TReadAllParams

The read all filters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TModelReadAllResult>>

Type Parameters

TModelReadAllResult

The model result type to map to

TApiReadAllResult

The api result type to map from

TReadAllParams

The ReadAll parameters type

SendSafeReadQuery<TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a SafeReadQuery<TResultData, TKey> to Apizr using MediatR

public Task<IApizrResponse<TApiEntity>> SendSafeReadQuery<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TApiEntity>>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendSafeReadQuery<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

Send a SafeReadQuery<TResultData, TKey> to Apizr using MediatR returning a mapped result

public Task<IApizrResponse<TModelEntity>> SendSafeReadQuery<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse<TModelEntity>>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

TApiEntityKey

The entity's crud key type

SendSafeUpdateCommand<TApiEntity, TApiEntityKey>(TApiEntityKey, TApiEntity, Action<IApizrRequestOptionsBuilder>)

Send a SafeUpdateCommand<TKey, TRequestData> to Apizr using MediatR

public Task<IApizrResponse> SendSafeUpdateCommand<TApiEntity, TApiEntityKey>(TApiEntityKey key, TApiEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

entity TApiEntity

The entity to update

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendSafeUpdateCommand<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey, TModelEntity, Action<IApizrRequestOptionsBuilder>)

Send a mapped SafeUpdateCommand<TKey, TRequestData> to Apizr using MediatR

public Task<IApizrResponse> SendSafeUpdateCommand<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey key, TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

entity TModelEntity

The entity to update

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<IApizrResponse>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

TApiEntityKey

The entity's crud key type

SendUpdateCommand<TApiEntity, TApiEntityKey>(TApiEntityKey, TApiEntity, Action<IApizrRequestOptionsBuilder>)

Send a UpdateCommand<TKey, TRequestData> to Apizr using MediatR

public Task SendUpdateCommand<TApiEntity, TApiEntityKey>(TApiEntityKey key, TApiEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

entity TApiEntity

The entity to update

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendUpdateCommand<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey, TModelEntity, Action<IApizrRequestOptionsBuilder>)

Send a mapped UpdateCommand<TKey, TRequestData> to Apizr using MediatR

public Task SendUpdateCommand<TModelEntity, TApiEntity, TApiEntityKey>(TApiEntityKey key, TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

entity TModelEntity

The entity to update

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

TApiEntityKey

The entity's crud key type