© 2026 Hedgehog Software, LLC
private JArray GetOptions( Type type, CultureInfo culture ) { var fields = type.IsEnum ? type.GetFields(BindingFlags.Public | BindingFlags.Static) : type.GetGenericArguments()[0] .GetFields(BindingFlags.Public | BindingFlags.Static); return new JArray(fields.Select(field => { var value = field.GetCustomAttribute<EnumMemberAttribute>() ?.Value ?? field.Name; var label = field.GetCustomAttribute<TitleLocalizedAttribute>() ?.ValueGet(field.Name, culture) ?? field.GetCustomAttribute<TitleAttribute>()?.Title ?? field.Name; return new JObject { ["label"] = label, ["value"] = value }; } ) ); }
IEnumerable<T>
T
Enum
IEnumerable<string>
string
List<string> str {get;set;} = new() {"a","b"};
a
b