Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The PersistentGenericSet is part of NHibernate (used to track changes in collections). It is based on the ISet interface and classes from Iesi.Collections, which was used to fill a gap in the .Net framework as there isn't a Set type. I guess that WCF has a problem serializing this type.</p> <p>A quick fix is to change your NHibernate mappings to use a Bag instead of a Set. Then you can use a normal <code>IList&lt;T&gt;</code> instead of <code>Set&lt;T&gt;</code> in your classes w.</p> <p>A better solution is to create a <a href="http://martinfowler.com/eaaCatalog/remoteFacade.html" rel="nofollow noreferrer">remote facade</a> which sends <a href="http://martinfowler.com/eaaCatalog/dataTransferObject.html" rel="nofollow noreferrer">DTOs</a> to your WCF endpoints. This will allow you to keep the interface of your internal types separate from those exposed as remote services. Jimmy Bogards <a href="http://automapper.codeplex.com/Wikipage" rel="nofollow noreferrer">Automapper</a> is a great tool which will help with the mapping process.</p> <h2>Edit</h2> <p>After re-reading the problem I had a look around the and came across this <a href="http://lunaverse.wordpress.com/2007/05/09/remoting-using-wcf-and-nhibernate/" rel="nofollow noreferrer">article</a> which describes a workaround for sending NHibernate collections over WCF. David Brion has written a good follow up <a href="http://davybrion.com/blog/2008/01/sending-nhibernate-entities-over-the-wcf-wire/" rel="nofollow noreferrer">article</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload