I have a database table having one of the column as nullable . I want to save an entity through NHibernate mapping which saves some default value in case of entity member being null. Entity:
public class Person
{
public virtual int PersonId { get; set; }
public virtual string Name { get; set; }
public virtual int ?Age { get; set; }
}
Person.hbm.xml file :
Now, when I am trying to save the entity with null value for Name and Age, I want the default value to be saved in database table. Is there any way for it? Please answer..