This commit is contained in:
2026-05-28 02:30:32 +03:30
parent f179e315c5
commit 7aa60b5e6e
2 changed files with 39 additions and 14 deletions
+38 -13
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using xDataService.Models;
using xModels.Dtos;
@@ -30,41 +31,57 @@ namespace xDataService.Interfaces
/// </summary>
/// <param name="providedForId"></param>
/// <param name="forIndex"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<TModel> GetReference(
TKey providedForId,
int forIndex = 0
int forIndex = 0,
CancellationToken cancellationToken = default
);
/// <summary>
/// Retrieve all Exists References of Specific Provided ID ...
/// </summary>
/// <param name="providedForId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IEnumerable<TModel>> GetAllReferences(TKey providedForId);
Task<IEnumerable<TModel>> GetAllReferences(
TKey providedForId,
CancellationToken cancellationToken = default
);
/// <summary>
/// Extract all Referencing Models for Specified Key ...
/// </summary>
/// <param name="providedForId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IEnumerable<XReference<TKey>>> GetAllReferencings(TKey providedForId);
Task<IEnumerable<XReference<TKey>>> GetAllReferencings(
TKey providedForId,
CancellationToken cancellationToken = default
);
/// <summary>
/// Count References ...
/// </summary>
/// <param name="providedForId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> CountReferences(TKey providedForId);
Task<int> CountReferences(
TKey providedForId,
CancellationToken cancellationToken = default
);
/// <summary>
/// Retrieve References of Specific Provided ID as Query ...
/// </summary>
/// <param name="providedForId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<XQueryResult<TModel>> QueryReferences(
XQuery query,
TKey providedForId
TKey providedForId,
CancellationToken cancellationToken = default
);
/// <summary>
@@ -72,13 +89,14 @@ namespace xDataService.Interfaces
/// </summary>
/// <param name="model"></param>
/// <param name="providedForId"></param>
/// <param name="forIndex"></param>
/// <param name="connectionId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> AddReference(
TModel model,
TKey providedForId,
string connectionId = null
string connectionId = null,
CancellationToken cancellationToken = default
);
/// <summary>
@@ -87,11 +105,13 @@ namespace xDataService.Interfaces
/// <param name="model"></param>
/// <param name="reference"></param>
/// <param name="connectionId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> AddReference(
TModel model,
XReference<TKey> reference,
string connectionId = null
string connectionId = null,
CancellationToken cancellationToken = default
);
/// <summary>
@@ -99,26 +119,29 @@ namespace xDataService.Interfaces
/// </summary>
/// <param name="model"></param>
/// <param name="providedForId"></param>
/// <param name="forIndex">if null, removes all</param>
/// <param name="connectionId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> RemoveReference(
TModel model,
TKey providedForId,
string connectionId = null
string connectionId = null,
CancellationToken cancellationToken = default
);
/// <summary>
/// Remove Reference a Model for Specific XRefence<TKey> ...
/// </summary>
/// <param name="model"></param>
/// <param name="providedForId"></param>
/// <param name="reference"></param>
/// <param name="connectionId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> RemoveReference(
TModel model,
XReference<TKey> reference,
string connectionId = null
string connectionId = null,
CancellationToken cancellationToken = default
);
/// <summary>
@@ -126,10 +149,12 @@ namespace xDataService.Interfaces
/// </summary>
/// <param name="providedForId"></param>
/// <param name="connectionId"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> RemoveReferences(
TKey providedForId,
string connectionId = null
string connectionId = null,
CancellationToken cancellationToken = default
);
#endregion
}