Class ApizrCrudOptionalMediator
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
mediatorIMediator
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
entityTApiEntityThe entity to create
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TApiEntity, ApizrException>>
Type Parameters
TApiEntityThe 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
entityTModelEntityThe entity to create
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TModelEntity, ApizrException>>
Type Parameters
TModelEntityThe model entity type to map from
TApiEntityThe 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
keyTApiEntityKeyThe entity key
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<Unit, ApizrException>>
Type Parameters
TApiEntityThe api entity type
TApiEntityKeyThe 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
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TReadAllResult, ApizrException<TReadAllResult>>>
Type Parameters
TReadAllResultThe "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
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>>
Type Parameters
TModelReadAllResultThe model result type to map to
TApiReadAllResultThe 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
readAllParamsTReadAllParamsThe read all filters
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TReadAllResult, ApizrException<TReadAllResult>>>
Type Parameters
TReadAllResultThe api result type
TReadAllParamsThe 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
readAllParamsTReadAllParamsThe read all filters
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TModelReadAllResult, ApizrException<TModelReadAllResult>>>
Type Parameters
TModelReadAllResultThe model result type to map to
TApiReadAllResultThe api result type to map from
TReadAllParamsThe 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
keyTApiEntityKeyThe entity key
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TApiEntity, ApizrException<TApiEntity>>>
Type Parameters
TApiEntityThe api entity type
TApiEntityKeyThe 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
keyTApiEntityKeyThe entity key
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<TModelEntity, ApizrException<TModelEntity>>>
Type Parameters
TModelEntityThe model entity type to map from
TApiEntityThe api entity type to map to
TApiEntityKeyThe 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
keyTApiEntityKeyThe entity key
entityTApiEntityThe entity to update
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<Unit, ApizrException>>
Type Parameters
TApiEntityThe api entity type
TApiEntityKeyThe 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
keyTApiEntityKeyThe entity key
entityTModelEntityThe entity to update
optionsBuilderAction<IApizrRequestOptionsBuilder>Options provided to the request
Returns
- Task<Option<Unit, ApizrException>>
Type Parameters
TModelEntityThe model entity type to map from
TApiEntityThe api entity type to map to
TApiEntityKeyThe entity's crud key type