MySql の日時フィールドが「0000-00-00 00:00:00」に等しい場合、NHibernate はそれを .net 日時に変換できません。
エラーメッセージ:
"Unable to convert MySQL date/time value to System.DateTime"
値を null または datetime.min にキャストするように Fluent NHibernate を構成するにはどうすればよいですか?
編集:
私はこれを試しました: NHibernate MySQL の日付/時刻の値を System.DateTime に変換できません が、機能しません。これが私の構成です:
string connectionString = "Server=SERVER;Port=3306;Database=DB;Uid=USER;Pwd=PASSWORD; Allow Zero Datetime=true;";
return Fluently.Configure()
.Database(MySQLConfiguration
.Standard
.ConnectionString(connectionString)
)
.Mappings(m =>
m.FluentMappings
.AddFromAssemblyOf<MyMapping>()
)
.BuildSessionFactory()
;