Fluent Nhibernate Automap convention for not-null field

Posted by user215015 on Stack Overflow See other posts from Stack Overflow or by user215015
Published on 2010-04-09T08:19:00Z Indexed on 2010/04/09 8:23 UTC
Read the original article Hit count: 402

Hi, Could some one help, how would I instruct automap to have not-null for a cloumn?

public class Paper : Entity
{
    public Paper() { }

            [DomainSignature]
            [NotNull, NotEmpty]
            public virtual string ReferenceNumber { get; set; }

            [NotNull]
            public virtual Int32 SessionWeek { get; set; }
}

But I am getting the following:

 <column name="SessionWeek"/>

I know it can be done using fluent-map. but i would like to know it in auto-mapping way. Many thanks.

Regards Robie

© Stack Overflow or respective owner

Related posts about automapping

Related posts about fluent-nhibernate