fix(esppSync): шорткоды применяются только к полям с типом string

This commit is contained in:
Mikhail Trubnikov
2026-01-14 10:34:37 +10:00
parent e347120cc3
commit c1ae107c1f

View File

@@ -127,12 +127,16 @@ namespace PARR.EsppSync
foreach (PropertyInfo property in properties)
{
var value = property.GetValue(dbObjectInEsppObject)?.ToString();
var type = property.PropertyType;
if(type == typeof(string)){
// только для стрингов проверяем шорткоды
var value = property.GetValue(dbObjectInEsppObject)?.ToString();
if (value != null)
{
var processedValue = await shortcodesService.ApplyShortcodesAsync(value, templateForShortcodes);
property.SetValue(dbObjectInEsppObject, processedValue);
if (value != null)
{
var processedValue = await shortcodesService.ApplyShortcodesAsync(value, templateForShortcodes);
property.SetValue(dbObjectInEsppObject, processedValue);
}
}
}