SyntaxFix
Write A Post
Hire A Developer
Questions
To avoid AmbiguousMatchException, I would rather say
AmbiguousMatchException
objectToCheck.GetType().GetMethods().Count(m => m.Name == method) > 0