views:

46

answers:

1

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.

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?

+1  A: 

You could use a settings table to store the preferences and add a value for every dialog:

Table Settings Id, UserId, DialogName, Value

1, 1, FirstDialog, True

2, 1, SecondDialog, False

3, 2, FirstDialog, False

4, 2, SecondDialog, False

fordan