private static void CheckDuplicateParameterNames(MethodBase[] methods)
{
int count = (from method in methods
let name = string.Join(",", from parameter in method.GetParameters()
orderby parameter.Name
select parameter.Name)
select name).Distinct().Count();
if (count != methods.Length)
throw new InvalidOperationException("Duplicate names detected for: " + methods[0].Name);
}