elty123
elty123

Reputation: 277

How to pass one overload of a method group?

Edit: It is my own mistake (combined with some unexpected changes outside). please ignore this post and sorry for inconvenience!

Before I used to just pass this method:

string DoSomething(string)

Now the vendor added another overload like void DoSomething(string, string). I tried to pass the method as a parameter but the compiler complains it cannot convert the method group, which makes sense I guess since DoSomething now has 2 signatures.

The question is, how do I pass just one signature?

Upvotes: 0

Views: 124

Answers (1)

Peter T. LaComb Jr.
Peter T. LaComb Jr.

Reputation: 2975

I believe you should define your parameters as either Action<string> or Action<string, string> depending on which method you wish to call.

The Action<T> Delegate

Upvotes: 1

Related Questions