views:

15

answers:

1

Hello, I'm a little bit of an NHibernate noobie, and I was wondering if NHibernate can work with internal types. I have a project with a bunch of internal entities, and I would like to use NHibernate within the project to access my data store. If I put the mapping files in the same assembly (or is this even necessary?), will NHibernate work with my internal entities? Or do they need to be declare public?

+1  A: 

It can. The mapping files location is not relevant.

Diego Mijelshon
Thanks Diego. Someone sent this response to me via Twitter -- has this been your experience too?"NH's own types need to reach into your ass'y and instantiate types so only if you use the [InternalsVisibleTo(..)] attribute"
Nicholas Cloud
No, it hasn't. In my tests, internal classes work fine. But you can always try and see for yourself :-)
Diego Mijelshon