using System.Collections.Generic;
using System.Threading.Tasks;
using xDataService.Models;
using xIdentityModels.Models;
using xModels.Dtos;
namespace xIdentityService.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 IXIdentityBaseReferencedProvider
{
//
#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
);
///
/// Retrieve all Exists References of Specific Provided ID ...
///
///
///
Task> GetAllReferences(TKey providedForId);
///
/// Extract all Referencing Models for Specified Key ...
///
///
///
Task>> GetAllReferencings(TKey providedForId);
///
/// Count References ...
///
///
///
Task CountReferences(TKey providedForId);
///
/// Retrieve References of Specific Provided ID as Query ...
///
///
///
Task> QueryReferences(
XQuery query,
TKey providedForId
);
///
/// Add Reference a Model to Specific Provided ID ...
///
///
///
///
///
///
Task AddReference(
TModel model,
TKey providedForId,
string connectionId = null,
XUserClaimsInfoDto userInfo = null
);
///
/// Add Reference a Model to Specific XRefence ...
///
///
///
///
///
///
Task AddReference(
TModel model,
XReference reference,
string connectionId = null,
XUserClaimsInfoDto userInfo = null
);
///
/// Remove Reference a Model for Specific Provided ID ...
///
///
///
///
///
///
Task RemoveReference(
TModel model,
TKey providedForId,
string connectionId = null,
XUserClaimsInfoDto userInfo = null
);
///
/// Remove Reference a Model for Specific XRefence ...
///
///
///
///
///
///
Task RemoveReference(
TModel model,
XReference reference,
string connectionId = null,
XUserClaimsInfoDto userInfo = null
);
///
/// Remove All References to Specified Key ...
///
///
///
///
///
Task RemoveReferences(
TKey providedForId,
string connectionId = null,
XUserClaimsInfoDto userInfo = null
);
#endregion
}
}