DataContract Serialization Error with NHibernate 1.2 class lazy="true"
Hi
We moved our application to NHibernat 1.2 GA from NHibernate 1.0.3.
If I declare our class definition in the mapping file by setting lazy="true", I am getting an exception that is raising Communication Exception
There was an error while trying to serialize parameterhttp://tempuri.org/:ExecuteServiceResult. The InnerException message was 'Type 'CProxyTypeDomainLocalAgencyEntityDomain_NHibernate_ProxyINHibernateProxy1' with data contract name 'CProxyTypeDomainLocalAgencyEntityDomain_NHibernate_ProxyINHibernateProxy1:http://schemas.datacontract.org/2004/07/' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.
Here is the corresponding class declaration in the mapping file.
<class name="Domain.LocalAgencyEntity, DataAccess" table="Zipcode" lazy="true" select-before-update="true">
..........
</class>
If I change that to
<class name="Domain.LocalAgencyEntity, DataAccess" table="Zipcode" lazy="false" select-before-update="true">
..........
</class>
it is working fine. Unfortunately lazy="true" is required by the architecture. Could anyone please help me in fixing this issue. I am running out of options.
Thanks
--Rama.NET--

