I’m just looking for some direction when it comes to NHibernate and WCF.
At the moment i have a many to one association between a person and address.
The first problem.
I have to eager load the list of addresses so it doesn’t generate a lazy loaded proxy. Is there a way to disable lazy loading completely? I never want to see it generated.
The second problem.
The bidirectional association between my poco’s is killing my standard serialization. What’s the best way forward. Should I remove the
Thanks for all your help
The best solution is NOT to expose your persistent classes in the service.
Instead, create DTO classes that contain only the information needed by each service call, and expose those.
You can use AutoMapper to avoid part of the work of mapping from/to the DTOs and the persistent classes.