32 lines
1.4 KiB
C#
32 lines
1.4 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
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="str">Строка из RabbitMQ</param>
|
|
/// <param name="parser">Делегат парсинга из строки в модель EsppObject</param>
|
|
/// <param name="converterToEsppObject"> Конвертирует BD Template в модель для сравнения</param>
|
|
/// <returns></returns>
|
|
Task SyncEsppObjectAsync(string str, ParserHandlerDelegate<EsppObject> parser, ConvertDbObjToComparisonObjHandlerDelegate<EsppObject> converterToEsppObject);
|
|
}
|
|
} |