internal static class DocumentConverterExtensions
{
private static void SetPropertyValue<T>(PropertyInfo property, T instance, string fieldValue)
where T : IDocument
{
if (!property.CanWrite || property.Name == nameof(IDocument.UniqueKey)) return;
var propertyType = GetUnderlyingType(property);
if (propertyType.IsEnum)
{
property.SetValue(instance, Enum.ToObject(propertyType, long.Parse(fieldValue)));
}
else ....
}
...
}