This might help: http://ayende.com/Blog/archive/2009/06/03/nhibernate-mapping-ndash-ltmapgt.aspx
Also, you could very easily create properties that read from the dictionary. So externally the object would appear to be strongly typed, but internally it would be reading from the dictionary that nhibernate maps. On Fri, Feb 12, 2010 at 3:56 PM, Ajai Shankar <[email protected]>wrote: > Fabio > > <how?> :-) > > I thought map was just for mapping dictionaries. > > From say these rows in Phones (PersonId, PhoneType, Number) > > 1, "home", "123" > 1, "work", "456" > > you are saying it's possible to map each row to individual properties - > wow! > > Person ( > Id = 1 > HomePhone= "123" > WorkPhone = "456" > ) > > instead of the usual: > > Person ( > Id = 1 > IDictionary<string, string> Phones = { > { "home", "123" }, > { "work", "456" } > } > ) > > Ajai > > > On Fri, Feb 12, 2010 at 3:34 PM, Fabio Maulo <[email protected]> wrote: > >> <map> >> >> 2010/2/12 improvingjef <[email protected]> >> >> Hi all. I am a fairly new nhibernate user, and I have a question about >>> a particular, oddball mapping I would like to perform. I have an >>> IConfiguration class that holds on to the configurable parts of the >>> system, e.g. some dependent server urls, min/max values, etc. I would >>> like to map to/from a table that is essentially name->value pairs, >>> e.g. >>> >>> public class Config : IConfiguration >>> { >>> public string ServerUri { get;set;} >>> public bool IsFoo {get; set;] >>> } >>> >>> mapped to >>> >>> table Configuration >>> ( >>> PropertyName varchar(...), >>> PropertyValue varchar(...) >>> ) >>> >>> with rows like "ServerUri"=>"http://foo", "IsFoo"=>,"true" >>> >>> Is there any out-of-the-box way to do something like this, or would I >>> need to implement, e.g., a custom persister? >>> >>> Best Regards, >>> Jef | Improving >>> >>> -- >>> 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]<nhusers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/nhusers?hl=en. >>> >>> >> >> >> -- >> Fabio Maulo >> >> >> -- >> 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]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- 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.
