SqlDateTime overflow using NHibernate

对着背影说爱祢 提交于 2019-12-06 10:49:06

thanks guys for your helpful comments.

The problem wast That I was fetching device object from DB which has a property LastActivityDate

List<Device> devices = session.QueryOver<Data.Model.Device>().List().ToList();

I had added this property to model after addding a device object with some info to the DB. this property was null, but I haden't defined LastActivityDate as a nullable property.

so this object was in the same session of app object. when I flushed the session, because LastActivityDate was null, SqlDateTime exception rised!

it's simple. but I spend hours to find it!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!