class MyAttribute: Attribute { }
public string MyProperty { get; set; }
public static void Main()
var attributes = typeof(MyClass).GetProperties().Where(x => x.GetCustomAttributes(typeof(MyAttribute), true).Any());
foreach (var attribute in attributes)
Console.WriteLine(attribute);