问题描述
我有一个带有NHibernate数据访问层的Web应用程序.我可以存储大量用户首选项,这些首选项主要是布尔值,例如注册对话框已被关闭并且不应再次显示.
I've got a web application with an NHibernate Data Access Layer. I have a large number of user preferences that can be stored, these are mainly booleans for example registering that a dialog has been dismissed and should not be showed again.
问题在于,使用NHibernate,我需要添加到我的数据库架构中,并且每次添加新对话框进行注册(无论是否关闭)时,都需要向持久性类中添加一个属性.
The problem is that with NHibernate I need to add to my database schema, and add a property to the persistent class every time a new dialog is added to register if it has been dismissed or not.
必须有一种更简单的方法.什么事?
There must be an easier way. What is it?
推荐答案
另一种选择是阅读帖子,基本上允许使用动态字段
Another option is to read this post by Ayende, basically allowing for dynamic fields
还阅读了Ayende的最新评论
Also read Ayende's last comment
编辑由于某种原因,我刚刚意识到我已经回答了这个已有一年多历史的问题!不知道我是怎么到这里的!答案仍然是一个很好的答案
Edit For some reason I have just realised that I have answered this question that is over one year old! Got no idea how I got here! Answer is still a good one though
这篇关于NHibernate Web应用程序-管理用户首选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!