persistence/Persistence/API/IApiDictionaryElement.cs

46 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
namespace Persistence.API;
/// <summary>
/// Интерфейс для API, предназначенного для работы с элементами справочников
/// </summary>
public interface IApiDictionaryElement<TDto> where TDto : class, new()
{
/// <summary>
/// Получить все данные справочника
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<IEnumerable<TDto>>> GetAsync(Guid dictionaryKey, CancellationToken token);
/// <summary>
/// Добавить элемент в справочник
/// </summary>
/// <param name="dictionaryKey">ключ справочника</param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<Guid>> AddAsync(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>> UpdateAsync(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>> DeleteAsync(Guid dictionaryKey, Guid dictionaryElementKey, CancellationToken token);
}