Answers for "c# get custom attribute from property"

C#
0

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");
Posted by: Guest on December-15-2020

Code answers related to "c# get custom attribute from property"

C# Answers by Framework

Browse Popular Code Answers by Language