NHibernate Web应用程序-管理用户首选项 [英] NHibernate Web Application - Managing User Preferences

查看:91
本文介绍了NHibernate Web应用程序-管理用户首选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有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

在许多应用程序中,一个共同的主题是 需要支持定制/动态 领域.换句话说,系统 管理员可以决定客户 需要有一些其他字段 不属于主线 开发.

A common theme in many application is the need to support custom / dynamic fields. In other words, the system admin may decide that the Customer needs to have a few additional fields that aren’t part of the mainline development.

还阅读了Ayende的最新评论

Also read Ayende's last comment

  • 您可以将集合放入动态属性中.
  • 您可以通过编程方式编辑配置
  • You can put a collection in a dynamic property.
  • You can edit the configuration programatically

编辑由于某种原因,我刚刚意识到我已经回答了这个已有一年多历史的问题!不知道我是怎么到这里的!答案仍然是一个很好的答案

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应用程序-管理用户首选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆