using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using xDataService.Models; using xModels.Dtos; namespace xDataService.Interfaces { /// /// in Some Cases we have Entities Which Can Referenced for Specified /// Provider and Types ... /// this interface Globaly introduce all available Actions for those ... /// /// TKey: type of Provider Models Keys ... /// TModel: type of Dto which Referenced ... /// public interface IXBaseReferencedProvider { // #region Props ... /// /// Provider Identifier ... /// string Provider { get; } #endregion // #region Referenced Actions ... /// /// Get Specified Indexed Reference for Specific Provided ID ... /// /// /// /// /// Task GetReference( TKey providedForId, int forIndex = 0, CancellationToken cancellationToken = default ); /// /// Retrieve all Exists References of Specific Provided ID ... /// /// /// /// Task> GetAllReferences( TKey providedForId, CancellationToken cancellationToken = default ); /// /// Extract all Referencing Models for Specified Key ... /// /// /// /// Task>> GetAllReferencings( TKey providedForId, CancellationToken cancellationToken = default ); /// /// Count References ... /// /// /// /// Task CountReferences( TKey providedForId, CancellationToken cancellationToken = default ); /// /// Retrieve References of Specific Provided ID as Query ... /// /// /// /// /// Task> QueryReferences( XQuery query, TKey providedForId, CancellationToken cancellationToken = default ); /// /// Add Reference a Model to Specific Provided ID ... /// /// /// /// /// /// Task AddReference( TModel model, TKey providedForId, string connectionId = null, CancellationToken cancellationToken = default ); /// /// Add Reference a Model to Specific XRefence ... /// /// /// /// /// /// Task AddReference( TModel model, XReference reference, string connectionId = null, CancellationToken cancellationToken = default ); /// /// Remove Reference a Model for Specific Provided ID ... /// /// /// /// /// /// Task RemoveReference( TModel model, TKey providedForId, string connectionId = null, CancellationToken cancellationToken = default ); /// /// Remove Reference a Model for Specific XRefence ... /// /// /// /// /// /// Task RemoveReference( TModel model, XReference reference, string connectionId = null, CancellationToken cancellationToken = default ); /// /// Remove All References to Specified Key ... /// /// /// /// /// Task RemoveReferences( TKey providedForId, string connectionId = null, CancellationToken cancellationToken = default ); #endregion } }