StefH / ProxyInterfaceSourceGenerator

This project uses Source Generation to generate an interface and a Proxy class for classes. This makes it possible to wrap external classes which do not have an interface, in a Proxy class which makes it easier to Mock and use Dependency Injection.
MIT License
38 stars 5 forks source link

Proxy does only proxy top level members #43

Closed rogeralsing closed 1 year ago

rogeralsing commented 1 year ago

If you proxy a subtype of any kind. only the methods in the subtype is proxied. no visible members from the base type(s) are part of the generated code.

e.g.

public class A 
{
    void Foo() {}
}

public class B : A 
{
     void Bar() {}
}

[ProxyInterfaceGenerator.Proxy(typeof(B))]
public partial interface IB {
}

The proxy will only contain code for Bar, nothing for Foo

StefH commented 1 year ago

@rogeralsing Actually, this should work like this : https://github.com/StefH/ProxyInterfaceSourceGenerator#proxybaseclasses

StefH commented 1 year ago

@rogeralsing Does this answer you question?

StefH commented 1 year ago

@rogeralsing Is this enough information for you?