persistence/Persistence/API/IDictionaryElementApi.cs

46 lines
1.9 KiB
C#
Raw Normal View History

using Microsoft.AspNetCore.Mvc;
2024-11-08 18:24:52 +05:00
namespace Persistence.API;
/// <summary>
/// Интерфейс для API, предназначенного для работы с элементами справочников
2024-11-08 18:24:52 +05:00
/// </summary>
public interface IDictionaryElementApi<TDto> where TDto : class, new()
2024-11-08 18:24:52 +05:00
{
/// <summary>
/// Получить все данные справочника
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-21 17:02:36 +05:00
Task<ActionResult<IEnumerable<TDto>>> Get(Guid dictionaryKey, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Добавить элемент в справочник
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-21 17:02:36 +05:00
Task<ActionResult<Guid>> Add(Guid dictionaryKey, TDto dto, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Изменить одну запись
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-21 17:02:36 +05:00
Task<ActionResult<Guid>> Update(Guid dictionaryKey, Guid dictionaryElementKey, TDto dto, CancellationToken token);
2024-11-08 18:24:52 +05:00
/// <summary>
/// Удалить одну запись
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
/// <param name="token"></param>
/// <returns></returns>
2024-11-21 17:02:36 +05:00
Task<ActionResult<int>> Delete(Guid dictionaryKey, Guid dictionaryElementKey, CancellationToken token);
2024-11-08 18:24:52 +05:00
}