Not sure if NH will do this but I thought I'd run it by you all. I'm using the 1.2 version w/ sql server.
I have a class called Spec (for specification) and a class called SpecValue that holds the specification values. Each SpecValue has a many-to-one to its Spec. I have another class called Floorplan. I would like the floorplan to have a property thats a generic IDicionary of SpecValues. But i'd like the key to be that SpecValue's Spec.Name which is a string. So I could do things like this:
var specName = someSpec.Name;
myFloorplan.SpecValues[specName].Value;
//these should be equal
myFloorplan.SpecValue[specName].Spec.Name == specName;
In the database there would just be a table called, floorplan, then one called Spec with name and ID, and finally SpecValue with ID, Value and foreign key SpecID, foreign key FloorplanID.
I don't really care about adding the specvalues to the dictionary to be saved, but when I get them out of the database, it would be nice if i could look the values up in floorplan using the Spec names.
Is this possible in NH, or am I getting too complicated?
|