<p>For some reason I'm not getting this. (Example model below) If I write: </p>

<pre><code>var property = typeof(sedan).GetProperty("TurningRadius");
Attribute.GetCustomAttributes(property,typeof(MyAttribute), false)
</code></pre>

<p>the call will return MyAttribute(2) despite indicating I don't want to search the inheritance chain. Does anyone know what code I can write so that calling</p>

<pre><code>MagicAttributeSearcher(typeof(Sedan).GetProperty("TurningRadius"))
</code></pre>

<p>returns nothing while calling</p>

<pre><code>MagicAttributeSearcher(typeof(Vehicle).GetProperty("TurningRadius"))
</code></pre>

<p>returns MyAttribute(1)?</p>

<hr>

<p>Example Model:</p>

<pre><code>public class Sedan : Car
{
    // ...
}

public class Car : Vehicle
{
    [MyAttribute(2)]
    public override int TurningRadius { get; set; }
}

public abstract class Vehicle
{
    [MyAttribute(1)]
    public virtual int TurningRadius { get; set; }
}
</code></pre>

I think this is what you're after - note that I had to make TurningRadius abstract in Vehicle and overridden in Car. Is that okay?
```
```
using System;
using System.Reflection;

public class MyAttribute : Attribute
{
    public MyAttribute(int x) {}
}

public class Sedan : Car
{
    // ...
}

public class Car : Vehicle
{
    public override int TurningRadius { get; set; }
}

public abstract class Vehicle
{
    [MyAttribute(1)]
    public virtual int TurningRadius { get; set; }
}

class Program
{
    static void Main(string[] args)
    {
        MagicAttributeSearcher(typeof(Sedan));
        MagicAttributeSearcher(typeof(Vehicle));
    }

    static void MagicAttributeSearcher(Type type)
    {
        PropertyInfo prop = type.GetProperty("TurningRadius");
        var attr = Attribute.GetCustomAttribute(prop, typeof(MyAttribute), false);
        Console.WriteLine("{0}: {1}", type, attr);
    }
}
```
```
Output:
```
```
Sedan:
Vehicle: MyAttribute
```
```