开发者

NHibernate property change tracking

What is the best way to implement property change tracking with NHibernate. I'm migrating an application from LINQ-to-SQL and am currently implementing it in the entity like so.

public class Task {

partial void OnLoaded() {
   OriginalTitle = Title;
}

public bool OriginalTitle { get; private set; }
public bool TitleChanged { get { return Title != OriginalTitle; } }

}

However, there is now OnLoaded event method in NHibernate. Is th开发者_JS百科ere a way this code could be auto-generated somehow?


You can try with session event listener: http://nhibernate.info/doc/howto/various/creating-an-audit-log-using-nhibernate-events

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜