last ...
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using xDataService.Models;
|
||||
using xIdentityModels.Models;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xIdentityService.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// a Referenced Service is a Service which can Referenced to other Items ...
|
||||
/// </summary>
|
||||
public interface IXBaseReferenced
|
||||
public interface IXBaseReferenced<TEntity, TKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// Get Reference Identifier for Specified Provider and Specified Item ...
|
||||
@@ -18,9 +21,9 @@ namespace xIdentityService.Interfaces
|
||||
/// <param name="providedFor"></param>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <returns></returns>
|
||||
string GetIdentifier<TKey>(
|
||||
string GetIdentifier<TReferenceKey>(
|
||||
string providedFor,
|
||||
TKey forProvidedId
|
||||
TReferenceKey forProvidedId
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@@ -31,10 +34,10 @@ namespace xIdentityService.Interfaces
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsProvidedFor<TKey>(
|
||||
Task<bool> IsProvidedFor<TReferenceKey>(
|
||||
string providedFor,
|
||||
TKey forProvidedId,
|
||||
Guid id,
|
||||
TReferenceKey forProvidedId,
|
||||
TKey id,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
@@ -49,10 +52,10 @@ namespace xIdentityService.Interfaces
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task AddReference<TKey>(
|
||||
Task AddReference<TReferenceKey>(
|
||||
string providedFor,
|
||||
TKey forProvidedId,
|
||||
Guid id,
|
||||
TReferenceKey forProvidedId,
|
||||
TKey id,
|
||||
int forIndex = 0,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
@@ -70,19 +73,28 @@ namespace xIdentityService.Interfaces
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task RemoveReference<TKey>(
|
||||
Task RemoveReference<TReferenceKey>(
|
||||
string providedFor,
|
||||
TKey forProvidedId,
|
||||
Guid id,
|
||||
TReferenceKey forProvidedId,
|
||||
TKey id,
|
||||
int forIndex = 0,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get Specified References ...
|
||||
/// </summary>
|
||||
/// <param name="providedFor"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <typeparam name="TReferenceKey"></typeparam>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XReference<string>>> GetReferences(
|
||||
Guid id,
|
||||
|
||||
string providedFor,
|
||||
TKey id,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xDataService.Models;
|
||||
using xModels.Base;
|
||||
|
||||
namespace xIdentityService.Interfaces
|
||||
@@ -58,6 +60,20 @@ namespace xIdentityService.Interfaces
|
||||
[FromQuery] object forProvidedId,
|
||||
[FromQuery] int forIndex = 0,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve References of Specified Itemfor providedFor ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="providedFor"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}/References")]
|
||||
Task<ActionResult<IEnumerable<XReference<string>>>> GetReferences(
|
||||
[FromRoute] TKey id,
|
||||
[FromQuery] string providedFor,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user