persistence/Persistence/Repositories/ITimeSeriesDataRepository.cs

50 lines
1.8 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 Persistence.Models;
namespace Persistence.Repositories;
/// <summary>
/// Интерфейс по работе с временными данными
/// </summary>
/// <typeparam name="TDto"></typeparam>
public interface ITimeSeriesDataRepository<TDto> : ISyncRepository<TDto>
where TDto : class, ITimeSeriesAbstractDto, new()
{
/// <summary>
/// Получить страницу списка объектов
/// </summary>
/// <param name="dateBegin">дата начала</param>
/// <param name="dateEnd">дата окончания</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<TDto>> GetAsync(DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
/// <summary>
/// Получить диапазон дат, для которых есть данные в репозитории
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto> GetDatesRangeAsync(CancellationToken token);
/// <summary>
/// Добавление записей
/// </summary>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> InsertRange(IEnumerable<TDto> dtos, CancellationToken token);
/// <summary>
/// Получение списка последних записей
/// </summary>
/// <param name="takeCount">количество записей</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<TDto>> GetLastAsync(int takeCount, CancellationToken token);
/// <summary>
/// Получение первой записи
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
Task<TDto?> GetFirstAsync(CancellationToken token);
}