public static Type GetBaseTypeWithTheSameName(Type type)
{
var typesWithSameName = new Stack<Type>();
var baseType = type;
do
{
if (baseType.GetOperationName() == type.GetOperationName())
typesWithSameName.Push(baseType);
}
while ((baseType = baseType.BaseType()) != null);
return typesWithSameName.Pop();
}
}