Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# get custom attribute from property

 PropertyInfo[] propertyInfos = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
PropertyInfo p = propertyInfos.Where(x => x.GetCustomAttribute<JsonPropertyAttribute>() != null && x.GetCustomAttribute<JsonPropertyAttribute>().PropertyName == "xx");
 
PREVIOUS NEXT
Tagged: #custom #attribute #property
ADD COMMENT
Topic
Name
9+9 =