Files
parr_api/PARR.EsppSync/ISyncService.cs
2023-11-22 12:04:33 +10:00

26 lines
1.1 KiB
C#

using PARR.Constants;
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);
}
}