Fluent-NHibernate - Component property attributes ignored by Convention

Posted by BobTodd on Stack Overflow See other posts from Stack Overflow or by BobTodd
Published on 2010-03-31T10:49:13Z Indexed on 2010/03/31 10:53 UTC
Read the original article Hit count: 304

I have a component with a number of properties that have various attributes

Normally when these attributes are added to a plain old domain object they are picked up by my custom AttributeConventions.

For the Component properties they are not. Is there some extra wiring needed for these?

e.g.

public class Component
{
    [Length(Max=50)]
    public virtual string Name {get; set;}
}

public class MyClass
{
    public virtual Component Component {get; set;}

    [Length(Max=50)]
    public virtual string Color {get; set;}
}

I get a table MyClass with columns Color & ComponentName

Color is an nvarchar(50) whilst ComponentName is an nvarchar(255) (the default)

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about component