For example, let's say I've defined an interface as follows:
public interface IWhatever
{
string Text { get; set; }
}
And I implement it in a mixin:
public class WhateverMixin : IWhatever
{
string IWhatever.Text { get; set; }
}
When I build a proxy of some given class, the whole explicitly-implemented interface member appears as implicitly implemented so it gets published.
Do you know if there's some option I can give to Castle DynamicProxy to force implementing an interface with explicit implementations?
Unfortunately, DynamicProx doesn't seem to have any options for this. There's no such setting in the ProxyGenerationOptions
or MixinData
classes, and if you look into the code (starting from MixinContributor
, which leads to MethodGenerator
), you can see that it simply copies the name and attributes (visibility, etc.) from the interface method.