I\'ve got a class with a number of attributes, and I need to find a way to get a count of the number of attributes it has. I want to do this because the class reads a CSV file,
Since the attributes are on the properties, you would have to get the attributes on each property:
Type type = typeof(StaffRosterEntry);
int attributeCount = 0;
foreach(PropertyInfo property in type.GetProperties())
{
attributeCount += property.GetCustomAttributes(false).Length;
}