I understand your pain. Unfortunately, I don't think there is a definitive answer to any architectural decisions.
Good luck. -------------------------------------------------- From: "graphicsxp" <[email protected]> Sent: Thursday, April 02, 2009 11:04 AM To: "nhusers" <[email protected]> Subject: [nhusers] Re: NHibernate and WCF > > Hi Richard, > > Thanks, I had already seen this thread and I read through it. But as > you can see there is not a definitive answer as to whether using DTO > is good or bad. > > This is quite difficult a decision to take I find.... :( , especially > since it's my first project with NH and WCF .... > > On 2 avr, 10:44, "Richard Brown \(GMail\)" <[email protected]> > wrote: >> http://groups.google.com/group/nhusers/browse_thread/thread/8f4933c7b... >> >> I'm not sure if this thread might help? >> >> Regards, >> Richard >> >> -------------------------------------------------- >> From: "graphicsxp" <[email protected]> >> Sent: Wednesday, April 01, 2009 9:32 PM >> To: "nhusers" <[email protected]> >> Subject: [nhusers] Re: NHibernate and WCF >> >> >> >> > There seems to be a huge debate about this. >> >> > The problem with DTO's is that I'm gonna have to duplicate my code, >> > i.e write code for my entities and my DTOs. I'm not sure how to do the >> > mapping either, it might be time-consuming. >> >> > On 1 avr, 15:32, "Francisco A. Lozano" <[email protected]> wrote: >> >> I don't think it's a good idea to throw entities over the wire... Why >> >> don't you have DTOs (DataContract) and entities as separate objects, >> >> and map between them? Entities are internal artifacts, I don't think >> >> they should be exposed as a service... >> >> >> Francisco A. Lozano >> >> >> On Tue, Mar 31, 2009 at 19:08, graphicsxp <[email protected]> >> >> wrote: >> >> >> > Hi, >> >> >> > I'm struggling to get WCF Service working with NHibernate. >> >> >> > I have a Post entity which holds a collection of Publication >> >> > entities >> >> > (lazy loaded). When the collection is loaded and the Post entity >> >> > returned to the client via WCF, there is an exception : >> >> >> > Type 'PublicationProxyc00e5dcd4dce4ee889643285aadb5575' cannot have >> >> > DataContractAttribute attribute Namespace set to null. >> >> >> > The type PublicationProxy was created by NHibernate but the >> >> > Publication class looks like : >> >> >> > [DataContract(Name = "Publication")] >> >> > public class Publication : IPublication >> >> > { >> >> > . >> >> > . >> >> > . >> >> > } >> >> >> > What can I do to workaround this issue ? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
