I have code:
public delegate int SomeDelegate(int p); public static int Inc(int p) { return p + 1; }
I can cast Inc to
Inc
The problem is that:
SomeDelegate a = Inc;
Isn't actually a cast. It's the short-form of:
SomeDelegate a = new SomeDelegate(Inc);
Therefore there's no cast. A simple solution to your problem can be this (in C# 3.0)
Func f = i=>a(i);