Files
parr_api/PARR.EsppSync/ISyncService.cs

25 lines
1.0 KiB
C#

using PARR.DAL.Models;
namespace PARR.EsppSync
{
/// <summary>
/// Делегат парсинга из строки в модель EsppObject
/// </summary>
/// <typeparam name="EsppObject"></typeparam>
/// <param name="str"></param>
/// <returns></returns>
public delegate EsppObject? ParserHandlerDelegate<EsppObject>(string str) where EsppObject : class, IEsppObject;
/// <summary>
/// Конвертирует Template в модель для сравнения
/// </summary>
/// <typeparam name="EsppObject"></typeparam>
/// <param name="templateName"></param>
/// <returns></returns>
public delegate EsppObject ConvertDbObjToComparisonObjHandlerDelegate<EsppObject>(Template template) where EsppObject : class, IEsppObject;
public interface ISyncService<EsppObject> where EsppObject : class, IEsppObject
{
Task SyncEsppObjectAsync(string str, ParserHandlerDelegate<EsppObject> parser, ConvertDbObjToComparisonObjHandlerDelegate<EsppObject> converterToEsppObject);
}
}