46 lines
1.9 KiB
C#
46 lines
1.9 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace Persistence.API;
|
||
|
||
/// <summary>
|
||
/// Интерфейс для API, предназначенного для работы с элементами справочников
|
||
/// </summary>
|
||
public interface IDictionaryElementApi<TDto> where TDto : class, new()
|
||
{
|
||
/// <summary>
|
||
/// Получить все данные справочника
|
||
/// </summary>
|
||
/// <param name="dictionaryKey">ключ справочника</param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<ActionResult<IEnumerable<TDto>>> Get(Guid dictionaryKey, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Добавить элемент в справочник
|
||
/// </summary>
|
||
/// <param name="dictionaryKey">ключ справочника</param>
|
||
/// <param name="dto"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<ActionResult<Guid>> Add(Guid dictionaryKey, TDto dto, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Изменить одну запись
|
||
/// </summary>
|
||
/// <param name="dictionaryKey">ключ справочника</param>
|
||
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
|
||
/// <param name="dto"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<ActionResult<Guid>> Update(Guid dictionaryKey, Guid dictionaryElementKey, TDto dto, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить одну запись
|
||
/// </summary>
|
||
/// <param name="dictionaryKey">ключ справочника</param>
|
||
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<ActionResult<int>> Delete(Guid dictionaryKey, Guid dictionaryElementKey, CancellationToken token);
|
||
}
|