I have a class like this:
public class test
{
public virtual int Id { get; private set; }
public virtual char testType { get; set; }
public virtual char testType2 { get; set; }
}
When I create this, but don't specificy testType2, I want the value to be "null" in the database. Instead, the value is an empty char. One way that I found to force this to be null is to use char? for the type. However, this apparently doesn't work for strings (doesn't compile), and I really don't want to mess with nullable types. Is there any way to get fluent nhibernate to always save uninitialized variables as "null"?
Edit: uninitialized string variables are saved as "null" in the db. I still need a solution for char and int.