[英]nHibernate set column value when entity is changed?
每当使用nHibernate更新了相关实体或表时,我都需要将日期列设置为当前日期时间?
You can use Interceptors as described here http://nhibernate.info/doc/nh/en/index.html#objectstate-interceptors 您可以按照此处所述使用拦截器http://nhibernate.info/doc/nh/en/index.html#objectstate-interceptors
The example given on this page will solve your problem if you use the event "OnFlushDirty" 如果使用事件“ OnFlushDirty”,此页面上的示例将解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.