Given a property in a class, with attributes - what is the fastest way to determine if it contains a given attribute? For example:
[IsNotNullable]
[I
You can use the Attribute.IsDefined method
https://msdn.microsoft.com/en-us/library/system.attribute.isdefined(v=vs.110).aspx
if(Attribute.IsDefined(YourProperty,typeof(YourAttribute)))
{
//Conditional execution...
}
You could provide the property you're specifically looking for or you could iterate through all of them using reflection, something like:
PropertyInfo[] props = typeof(YourClass).GetProperties();