Question

I have implemented a generic IPropertyChangedNotifier using castle dynamic proxy. Here I intercept setter call in Proxy objects so that i don't have to raise PropertyChanged event in setters of my domain objects.

The purpose was to use these proxy objects to bind it UI in a silevrlight application.

The Problem is serialization of proxy object fails in WCF service call which is due to absence of [DataContract] on proxy object. to get around the problem I had to keep a copy of instance in my interceptor and send this object for serialization.IPropertyChangedNotifier

This has resulted in complicated code which is difficult to debug or understand. Is there a simple way to solve the serialization problem in WCF to tell the serializer to use [DataContract] attribute of base class(instance) while sending a proxy in service call.

Was it helpful?

Solution 2

We Dropped DynamicProxies and now using PostSharp for Generic IPropertyChangedNotifier. No probs with serialization...

OTHER TIPS

What if you cast to the base class type?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top