views:

55

answers:

1

How can i ignore a property by decorating a property with an attribute? the base class AttributePropertyConvention doesn't seems to have that ability, or can it? Doesn't find anything sutiable on IPropertyInstance to set..

A: 

it was very easy:

public class IgnoreAttributeConvention : AttributePropertyConvention<IgnoreAttribute>
{
    protected override void Apply(IgnoreAttribute attribute, IPropertyInstance instance)
    {
        instance.ReadOnly();
    }
}

where IgnoreAttribute is a simple/empty attribute.

Carl Hörberg