Search code examples
c#resharperdelegation

C# Delegating Members - Resharper


Resharper can create Delegating Members (Alt + Ins)

But what are delegating members?

Most of the searches I do come up with American Politics which is not useful.


Solution

  • Delegating methods are simply methods that tunnel directly through to some contained object.

    For instance:

    class MyClass
    {
        private SomeType innerObj = new SomeType();
        public Bar GetFoo()
        {
            return innerObj.GetFoo();
        }
    
    }