nhibernate - How do I specify a property as required (NOT NULLABLE)? -
i trying hand @ nhibernate's built-in mapping code. i've got working now. problem how configure properties on objects required in database within convention? i'm guessing sort of attribute markup?
i know if mappings hand, can configure them required, how do conventions?
simply use nullable types, example in class,
public class foo { public int bar { get; set; } public int? baz { get; set; } }
bar not nullable, while baz nullable in db when use mapping code.
Comments
Post a Comment