Return Type Inference : Interface « Reflection « C# / CSharp Tutorial






using System;
using System.ComponentModel;


    delegate T MyFunc<T>();
    class MainClass
    {
        static void WriteResult<T>(MyFunc<T> function)
        {
            Console.WriteLine(function());
        }

        static void Main()
        {
            WriteResult(delegate { return 5; });
        }
    }








19.9.Interface
19.9.1.Get all implemented interface and their methods
19.9.2.Map Interface Methods To Class Methods
19.9.3.Type: IsNestedPrivate, IsNestedPublic
19.9.4.Return Type Inference