У меня есть класс Date, который переносится поверх DateTime? класс (помогает в насмешках DateTime.Now, наш домен и т. д.)
Класс класса Date имеет только одно защищенное свойство: DateTime? дата
public class Date
{
protected DateTime? date;
}
// mapping in hbm
<component name="CompletedOn">
<property column="StartedOn" name="date" access="field" not-null="false" />
</component>
Из документов nhibernate:
Like all value types, components do not support shared references. The null value semantics of a component are ad hoc. When reloading the containing object, NHibernate will assume that if all component columns are null, then the entire component is null. This should be okay for most purposes.
Могу ли я изменить это поведение? Я хочу, чтобы мой класс Date создавался, даже если date равен нулю.
Спасибо