Hello!
We are still using 1.0.2 and want to proxy our classes. Because of generic methods in our base class and the incompatibility of DynamicProxy and generic methods we implemented interface proxies. As access strategy we are using a custom accessor derived by IPropertyAccessor.
In the mapping files we declared the interface to use as the proxy interface for the classes.
Now we run into two problems:
1. Having a superclass (Super) and two derived subclasses (SubA, SubB) and using the type Super as association in another class, we have the problem that we cannot distinguish from which sub type the proxy is. Checking the object’s type with the is operator returns always true. (obj is SubA == true and obj is SubB == true).
2. If SubA and SubB have properties with the same name, we get a System.Reflection.TargetException: Object does not match target type. It seems that it is by pure chance accessing the property of the accessed type. The reason is that all derived interfaces are aggregated within the proxy, isn’t it?
So, is this behaviour unavoidable and the only possibility is not to use the is operator and to define unique names for properties and methods in a hierarchy?
|