Thank you, Fabio.

Where can you get NHibernate 2.1?  Isn't the current version 2.0.1 GA?

Thanks.

On Mar 4, 11:13 pm, Fabio Maulo <[email protected]> wrote:
> http://fabiomaulo.blogspot.com/2008/10/less-than-few-is-gof.htmlTheother
> approach if you want work with interfaces and dynamic-entities (a little bit
> more typed).
>
> 2009/3/5 Fabio Maulo <[email protected]>
>
>
>
>
>
> > Here the answer
> >http://fabiomaulo.blogspot.com/2008/10/less-than-gof-is-hbm.html
>
> > 2009/3/5 joel.barber <[email protected]>
>
> >> Does anyone out there know how to do the following?
>
> >> I would like to store values retrieved from the database with
> >> NHibernate in a dictionary instead of using class properties. For
> >> example, let's say we have a table Employee with three fields: Id,
> >> FirstName, and LastName.
>
> >> I would like to have a class as follows:
>
> >> public class Employee
> >> {
> >>    private Int64 _id;
>
> >>    public Int64 Id
> >>    {
> >>        get { return _id; }
> >>        set { _id = value; }
> >>    }
> >>    private IDictionary<String, Object> _properties;
> >>    public IDictionary<String, Object> Properties
> >>    {
> >>        get { return _properties; }
> >>        set { _properties = value; }
> >>    }
> >>    public void AddProperty(String keyName, Object value)
> >>    {
> >>        _properties.Add(keyName, value);
> >>    }
>
> >>    public Object GetProperty(String keyName)
> >>    {
> >>        return _properties[keyName];
> >>    }
> >> }
>
> >> Then, I would like for NHibernate, when retrieving/persisting the
> >> data, to call methods (or some means) like AddProperty/GetProperty to
> >> add the values for FirstName, LastName to the dictionary using the
> >> column name as the key.
>
> >> Is this possible? What I am trying to accomplish is providing a
> >> generic class that doesn't need to be compiled everytime a property is
> >> added.
>
> >> Thanks-in-advance.
>
> > --
> > Fabio Maulo
>
> --
> Fabio Maulo- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to