using Newtonsoft.Json; namespace Infrastructure.Verticals.DownloadClient.Deluge.Extensions; internal static class DelugeExtensions { public static List GetAllJsonPropertyFromType(this Type t) { var type = typeof(JsonPropertyAttribute); var props = t.GetProperties() .Where(prop => Attribute.IsDefined(prop, type)) .ToList(); return props .Select(x => x.GetCustomAttributes(type, true).Single()) .Cast() .Select(x => x.PropertyName) .ToList(); } }