I am trying to invoke a function for every member of a list, but pass additional parameters to the delegate.
if I have a list called documents
Use lambda expressions instead of method groups:
List<string> documents = GetAllDocuments();
documents.ForEach( d => CallAnotherFunction(d, "some content") );
List<string> templates = GetAllTemplates();
templates.ForEach( t => CallAnotherFunction(t, "other content") );
Use lambda expression:
string content = "Other parameter value";
documents.ForEach(x => CallAnotherFunction(x, content));