Is there a more concise way to add this function to the object
list? I'd like to avoid having to assign into the intermediate addFunc
variable.
static void Main(string[] args)
{
List<object> myObjects = new List<object>();
//myObjects.Add(AddThings);
Func<int, int, int> addFunc = AddThings;
myObjects.Add(addFunc);
}
static int AddThings(int x, int y) { return x + y; }