I have the following problem.
In my program I have class like
Code:
SomethingConfiguration
{
bool CanSomeoneMakeAction1{get;}
bool CanSomeoneMakeAction2{get;}
bool CanSomeoneMakeAction3{get;}
bool CanSomeoneMakeAction4{get;}
..
int SomeIntegerProperty{get;}
...
}
By the way number of fields in class increases - so table, associated with this class began to have overdoze of columns. There is problems with extending configuration with new property.
example:
table SomethingConfiguration
(SomethingConfigurationId, CanSomeoneMakeAction1 bit,
CanSomeoneMakeAction2 bit,
CanSomeoneMakeAction3 bit,
CanSomeoneMakeAction4 bit,
SomeIntegerProperty int
)
table contents example:
1,true,true,false,true,46
I want to store field values of this class as name-value collections in table
example:
table SomethingConfiguration
(SomethingConfigurationId, PropertyName, PropertyValue)
table contents example:
1, "CanSomeoneMakeAction1", "true"
1, "CanSomeoneMakeAction2", "true"
1, "CanSomeoneMakeAction3", "false"
1, "CanSomeoneMakeAction2", "true"
1, "SomeIntegerProperty", "46"
Can NHibernate help me do what I want?