user34537
user34537

Reputation:

C# how can i inline a delegate prototype?

Instead of this can i write it in such a way that the definition is inside the function?

    delegate object ObjFunc(long c);
    static Object MyFunc(this SqlConnection conn, ObjFunc func)
    {
        return func(1);
    }

Upvotes: 0

Views: 190

Answers (1)

wj32
wj32

Reputation: 8403

You can't. But you may want to use Func<long, object> already present in .NET 3.5.

Upvotes: 4

Related Questions