79 lines
2.9 KiB
C#
79 lines
2.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using xDataService.Models;
|
|
using xModels.Base;
|
|
|
|
namespace xIdentityService.Interfaces
|
|
{
|
|
public interface IXBaseReferencedController<TEntity, TKey>
|
|
where TEntity : XBaseEntity<TKey>
|
|
{
|
|
/// <summary>
|
|
/// Check an Item Has Reference to Specified ProvideFor and Specified forProvidedId ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="providedFor"></param>
|
|
/// <param name="forProvidedId"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("{id}/Reference/IsProvidedFor")]
|
|
Task<ActionResult<bool>> IsProvidedFor(
|
|
[FromRoute] TKey id,
|
|
[FromQuery] string providedFor,
|
|
[FromQuery] object forProvidedId,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Add a Reference to Item for Specified ProvideFor and Specified forProvidedId ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="providedFor"></param>
|
|
/// <param name="forProvidedId"></param>
|
|
/// <param name="forIndex"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("{id}/Reference")]
|
|
Task<ActionResult> AddReference(
|
|
[FromRoute] TKey id,
|
|
[FromQuery] string providedFor,
|
|
[FromQuery] object forProvidedId,
|
|
[FromQuery] int forIndex = 0,
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
|
|
/// <summary>
|
|
/// Remove a Reference from Item for Specified ProvideFor and Specified forProvidedId ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="providedFor"></param>
|
|
/// <param name="forProvidedId"></param>
|
|
/// <param name="forIndex"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
[HttpDelete("{id}/Reference")]
|
|
Task<ActionResult> RemoveReference(
|
|
[FromRoute] TKey id,
|
|
[FromQuery] string providedFor,
|
|
[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
|
|
);
|
|
}
|
|
} |