Files
hcs/Hcs.Client/ClientApi/NsiApi/HcsNsiApi.cs

37 lines
1.1 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 Hcs.ClientApi.DataTypes;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Hcs.ClientApi.NsiApi
{
public class HcsNsiApi
{
public HcsClientConfig Config { get; private set; }
public HcsNsiApi(HcsClientConfig config)
{
Config = config;
}
/// <summary>
/// Возвращает данные справочников поставщика информации
/// </summary>
/// <param name="regNum">Реестровый номер справочника</param>
/// <param name="token">Токен отмены</param>
/// <returns>Список справочников</returns>
public async Task<IEnumerable<ГисСправочник>> GetNsiItem(int regNum, CancellationToken token = default)
{
try
{
var method = new HcsMethodExportNsi(Config);
return await method.GetNsiItem(regNum, token);
}
catch (HcsNoResultsRemoteException)
{
return [];
}
}
}
}