Encapsulation is a concept that I am familiar with, however for the
simple entity type described,
needing to have private properties is totally unnecessary IMO.

If I need to change my type definition to work for NH but still be
immutable I can use the following approach:

public class Entity
  {
      private readonly int m_Property1;
      private readonly int m_Property2;
        
          public int Property1 { get { return this.m_Property1; } }
        
          public int Property2 { get { return this.m_Property2; } }

      public Entity(int p1, int p2)
      {
          this.m_Property1 = p1;
          this.m_Property2 = p2;
          }
  }

  But just to be clear, NHibernate cannot work with with entity types
as defined previously?
On Thu, Sep 3, 2009 at 9:27 PM, Paco Wensveen<[email protected]> wrote:
>
> The lack of incapsulation. You can not inherit this class and change
> anything. This also means it cannot be proxied by NHibernate.
>
> Protect your private parts!

--~--~---------~--~----~------------~-------~--~----~
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