Table of Contents

Class ApizrCrudOptionalMediator<TApiEntity, TApiEntityKey, TReadAllResult, TReadAllParams>

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

Apizr mediator dedicated to cruding and with optional result

public class ApizrCrudOptionalMediator<TApiEntity, TApiEntityKey, TReadAllResult, TReadAllParams> : IApizrCrudOptionalMediator<TApiEntity, TApiEntityKey, TReadAllResult, TReadAllParams>, IApizrCrudOptionalMediatorBase, IApizrCrudMediatorBase, IApizrOptionalMediatorBase, IApizrMediatorBase where TApiEntity : class

Type Parameters

TApiEntity
TApiEntityKey
TReadAllResult
TReadAllParams
Inheritance
ApizrCrudOptionalMediator<TApiEntity, TApiEntityKey, TReadAllResult, TReadAllParams>
Implements
IApizrCrudOptionalMediator<TApiEntity, TApiEntityKey, TReadAllResult, TReadAllParams>
Inherited Members

Constructors

ApizrCrudOptionalMediator(IApizrCrudOptionalMediator)

public ApizrCrudOptionalMediator(IApizrCrudOptionalMediator apizrMediator)

Parameters

apizrMediator IApizrCrudOptionalMediator

Methods

SendCreateOptionalCommand(TApiEntity, Action<IApizrRequestOptionsBuilder>)

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

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

Parameters

entity TApiEntity
optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TApiEntity, ApizrException>>

SendCreateOptionalCommand<TModelEntity>(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>(TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

entity TModelEntity
optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<TModelEntity, ApizrException>>

Type Parameters

TModelEntity

SendDeleteOptionalCommand(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

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

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

SendReadAllOptionalQuery(Action<IApizrRequestOptionsBuilder>)

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

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

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

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

SendReadAllOptionalQuery(TReadAllParams, Action<IApizrRequestOptionsBuilder>)

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

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

SendReadAllOptionalQuery<TModelReadAllResult>(Action<IApizrRequestOptionsBuilder>)

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

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

Parameters

optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

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

Type Parameters

TModelReadAllResult

SendReadAllOptionalQuery<TModelReadAllResult>(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>(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

SendReadOptionalQuery(TApiEntityKey, Action<IApizrRequestOptionsBuilder>)

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

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

SendReadOptionalQuery<TModelEntity>(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>(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

SendUpdateOptionalCommand(TApiEntityKey, TApiEntity, Action<IApizrRequestOptionsBuilder>)

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

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

Parameters

key TApiEntityKey

The entity key

entity TApiEntity
optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<Unit, ApizrException>>

SendUpdateOptionalCommand<TModelEntity>(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>(TApiEntityKey key, TModelEntity entity, Action<IApizrRequestOptionsBuilder> optionsBuilder = null)

Parameters

key TApiEntityKey

The entity key

entity TModelEntity
optionsBuilder Action<IApizrRequestOptionsBuilder>

Options provided to the request

Returns

Task<Option<Unit, ApizrException>>

Type Parameters

TModelEntity