Convert Action<T> to Action<object>

Viewed 14145

How do I convert Action<T> to Action<Object> in C#?

5 Answers

You can add generic parameter like this

    Action<object> Function<T>(Action<T> act) where T : class
    {
        return (Action<object>)act;
    }
Related