0

I want to create custom WeakReference<T> which would implement an interface passed as generic parameter T.

Usage:

interface IInterface
{
    void SomeMethod(bool param);
}

public class Subject : IInterface { /*...*/ }

var proxyRef = new ProxyWeakReference<IInterface>(new Subject());
proxyRef.SomeMethod(false);
IInterface subject = proxyRef.Target;

Is there any already created solutions to do that? Or what i should use to create such type of proxy?

Towelie
  • 99
  • 2
  • 10

1 Answers1

0

Probably, You are looking for a Moq

lilo.jacob
  • 2,334
  • 1
  • 20
  • 17