DynamicComponent is generally for the cases when you know the attributes upfront and the only "dynamic" part is that you don't have it as a properties in your object model, but in a IDictionary instead.
If you're looking for truly dynamic key-value store, you probably want to use Map: http://ayende.com/blog/4045/nhibernate-mapping-map and mapping-by-code: http://notherdev.blogspot.com/2012/02/mapping-by-code-map.html Regards, Adam On 14 Mar, 10:04, Exodus <[email protected]> wrote: > Hi, > > I have this code: > > mapper.Class<Test>(ca => > { > ca.Component(x => x.DynamicAttributes, new > { > SomeStringAttribute1 = "" > }, dc => > { > dc.Property(arg => > arg.SomeStringAttribute1); > }); > } > ); > > Is there a way to map a variable number of "SomeStringAttributes" where I > know the number first at runtime. I know I could generate XML for the > mapping and do it that way, but is it a way to do this when mapping by > code? :) > > Regards, > Peter -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
