Table of Contents

Class ApizrCrudOptionalMediator

Namespace
Apizr.Optional.Cruding.Sending
Assembly
Apizr.Integrations.Optional.dll

Apizr mediator dedicated to cruding and with optional result

public class ApizrCrudOptionalMediator : ApizrMediatorBase, IApizrCrudOptionalMediator, IApizrCrudOptionalMediatorBase, IApizrCrudMediatorBase, IApizrOptionalMediatorBase, IApizrMediatorBase
Inheritance
ApizrCrudOptionalMediator
Implements
Inherited Members

Constructors

ApizrCrudOptionalMediator(IMediator)

public ApizrCrudOptionalMediator(IMediator mediator)

Parameters

mediator IMediator

Methods

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

Send a CreateOptionalCommand<TModelData> to Apizr using MediatR and returning an optional result

public Task<Option<TApiEntity, ApizrException>> SendCreateOptionalCommand<TApiEntity>(TApiEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TApiEntity

The entity to create

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TApiEntity, ApizrException>>

Type Parameters

TApiEntity

The api entity type

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

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

public Task<Option<TModelEntity, ApizrException>> SendCreateOptionalCommand<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<Option<TModelEntity, ApizrException>>

Type Parameters

TModelEntity

The model entity type to map from

TApiEntity

The api entity type to map to

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

Send a DeleteCommand<T, TKey> to Apizr using MediatR and returning an optional result

public Task<Option<Unit, ApizrException>> SendDeleteOptionalCommand<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<Unit, ApizrException>>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

SendReadAllOptionalQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder>)

Send a ReadAllQuery<TReadAllResult> to Apizr using MediatR and returning an optional result

public Task<Option<TReadAllResult, ApizrException<TReadAllResult>>> SendReadAllOptionalQuery<TReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TReadAllResult, ApizrException<TReadAllResult>>>

Type Parameters

TReadAllResult

The "ReadAll" query result type

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

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

public Task<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>> SendReadAllOptionalQuery<TModelReadAllResult, TApiReadAllResult>(Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>>

Type Parameters

TModelReadAllResult

The model result type to map to

TApiReadAllResult

The api result type to map from

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

Send a ReadAllQuery<TReadAllResult> to Apizr using MediatR and returning an optional result

public Task<Option<TReadAllResult, ApizrException<TReadAllResult>>> SendReadAllOptionalQuery<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<Option<TReadAllResult, ApizrException<TReadAllResult>>>

Type Parameters

TReadAllResult

The api result type

TReadAllParams

The ReadAll parameters type

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

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

public Task<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>> SendReadAllOptionalQuery<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<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>>

Type Parameters

TModelReadAllResult

The model result type to map to

TApiReadAllResult

The api result type to map from

TReadAllParams

The ReadAll parameters type

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

Send a ReadQuery<TResultData, TKey> to Apizr using MediatR and returning an optional result

public Task<Option<TApiEntity, ApizrException<TApiEntity>>> SendReadOptionalQuery<TApiEntity, TApiEntityKey>(TApiEntityKey key, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TApiEntity, ApizrException<TApiEntity>>>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

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

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

public Task<Option<TModelEntity, ApizrException<TModelEntity>>> SendReadOptionalQuery<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<Option<TModelEntity, ApizrException<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

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

Send a UpdateCommand<TKey, TRequestData> to Apizr using MediatR and returning an optional result

public Task<Option<Unit, ApizrException>> SendUpdateOptionalCommand<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<Option<Unit, ApizrException>>

Type Parameters

TApiEntity

The api entity type

TApiEntityKey

The entity's crud key type

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

Send a mapped UpdateCommand<TKey, TRequestData> to Apizr using MediatR and returning an optional result

public Task<Option<Unit, ApizrException>> SendUpdateOptionalCommand<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<Option<Unit, ApizrException>>

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