Interface IInternalEntityViewRepository<TEntityView>
- Namespace
- GroupeIsa.Neos.Application.Persistence
- Assembly
- GroupeIsa.Neos.Application.Abstractions.dll
Provides the internal functionalities of an entity view persistence.
public interface IInternalEntityViewRepository<TEntityView> : IEntityViewRepository<TEntityView>, IEntityViewRepository where TEntityView : class, IEntityView
Type Parameters
TEntityViewThe entity view type.
- Inherited Members
Properties
AdditionalDataExpressions
Gets or sets the additional data expressions.
AdditionalDataExpressions AdditionalDataExpressions { get; set; }
Property Value
SearchExpression
Gets or sets the search expression.
Expression<Func<TEntityView, string, bool>>? SearchExpression { get; set; }
Property Value
- Expression<Func<TEntityView, string, bool>>
Methods
AddFromExternalSourceAsync(TEntityView, CancellationToken)
Adds an item from an external source.
Task<TEntityView> AddFromExternalSourceAsync(TEntityView entityView, CancellationToken cancellationToken = default)
Parameters
entityViewTEntityViewThe entity view item.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TEntityView>
The added entity view item.
AddOrGetInstanceFromExternalSourceAsync(TEntityView?, TEntityView?, CancellationToken)
Adds or gets the optional instance from an external source.
Task<TEntityView?> AddOrGetInstanceFromExternalSourceAsync(TEntityView? destination, TEntityView? source, CancellationToken cancellationToken = default)
Parameters
destinationTEntityViewThe destination.
sourceTEntityViewThe source.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TEntityView>
The entity view item.
Remarks
Used to generate EntityViewRepository{TEntityView}.UpdateReferencesAsync. See GroupeIsa.Neos.Generator.ServerSolution.Application.Persistence.AllRepositories.
AddOrGetRequiredInstanceFromExternalSourceAsync(TEntityView, TEntityView, CancellationToken)
Adds or gets the required instance from an external source.
Task<TEntityView> AddOrGetRequiredInstanceFromExternalSourceAsync(TEntityView destination, TEntityView source, CancellationToken cancellationToken = default)
Parameters
destinationTEntityViewThe destination.
sourceTEntityViewThe source.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TEntityView>
The entity view item.
Remarks
Used to generate EntityViewRepository{TEntityView}.UpdateReferencesAsync. See GroupeIsa.Neos.Generator.ServerSolution.Application.Persistence.AllRepositories.
AddOrUpdateFromExternalSourceOnEditableReferenceAsync(TEntityView, TEntityView?, CancellationToken)
Adds or updates entity view from external source on editable reference.
Task<TEntityView> AddOrUpdateFromExternalSourceOnEditableReferenceAsync(TEntityView sourceEditableReference, TEntityView? destinationEditableReference, CancellationToken cancellationToken = default)
Parameters
sourceEditableReferenceTEntityViewThe source.
destinationEditableReferenceTEntityViewThe current destination instance.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
GetPagedListAsync(int, int, EntityViewParameters<TEntityView>, Func<IQueryable<TEntityView>, IQueryable<TEntityView>>?, bool, CancellationToken)
Gets paged entity view items with optional exact total count computation.
Task<IPagedList<TEntityView>> GetPagedListAsync(int skip, int top, EntityViewParameters<TEntityView> parameters, Func<IQueryable<TEntityView>, IQueryable<TEntityView>>? queryCustomization, bool includeTotalCount, CancellationToken cancellationToken)
Parameters
skipintThe number of elements to skip.
topintThe number of elements to return.
parametersEntityViewParameters<TEntityView>Parameters.
queryCustomizationFunc<IQueryable<TEntityView>, IQueryable<TEntityView>>Query customization.
includeTotalCountboolTrue to compute the exact total record count; false to avoid the count query.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<IPagedList<TEntityView>>
The paged entity view items.
GetPagedTransformedListAsync(int, int, EntityViewParameters<TEntityView>, Func<IQueryable<TEntityView>, IQueryable<object>>, Func<IQueryable<TEntityView>, IQueryable<TEntityView>>?, CancellationToken)
Gets paged transformed items.
Task<IPagedList<object>> GetPagedTransformedListAsync(int skip, int top, EntityViewParameters<TEntityView> parameters, Func<IQueryable<TEntityView>, IQueryable<object>> queryTransformation, Func<IQueryable<TEntityView>, IQueryable<TEntityView>>? queryCustomizationBeforeTransformation = null, CancellationToken cancellationToken = default)
Parameters
skipintThe number of elements to skip.
topintThe number of elements to return.
parametersEntityViewParameters<TEntityView>Parameters.
queryTransformationFunc<IQueryable<TEntityView>, IQueryable<object>>The query transformation.
queryCustomizationBeforeTransformationFunc<IQueryable<TEntityView>, IQueryable<TEntityView>>The query customization before the transformation.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<IPagedList<object>>
The entity view items.
ReloadAsync(TEntityView, CancellationToken)
Reloads the entity view item.
Task<Result<TEntityView>> ReloadAsync(TEntityView entityView, CancellationToken cancellationToken = default)
Parameters
entityViewTEntityViewThe entity view item to reload.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<Result<TEntityView>>
A result that contains the reloaded entity view item or an error if the reload has failed.
RemoveFromCache(TEntityView)
Removes an item from the cache.
void RemoveFromCache(TEntityView entityView)
Parameters
entityViewTEntityViewThe item to remove.
UpdateFromExternalSourceAsync(object, TEntityView, CancellationToken)
Finds if destination exists according to the key and updates from an external source.
Task<Result<TEntityView>> UpdateFromExternalSourceAsync(object key, TEntityView source, CancellationToken cancellationToken = default)
Parameters
keyobjectThe item key.
sourceTEntityViewThe new item content.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<Result<TEntityView>>
trueif the item was found and updated; otherwisefalse.
UpdateFromExternalSourceAsync(TEntityView, TEntityView, CancellationToken)
Updates an item from an external source.
Task<TEntityView> UpdateFromExternalSourceAsync(TEntityView source, TEntityView destination, CancellationToken cancellationToken = default)
Parameters
sourceTEntityViewThe new item content.
destinationTEntityViewThe item to update.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TEntityView>
trueif the item was found and updated; otherwisefalse.