Why is this an issue?
The name of a parameter in an externally visible. This rule raises an issue when method override does not match the name of the parameter in the
base declaration of the method, or the name of the parameter in the interface declaration of the method or the name of any other partial
definition.
Noncompliant code example
partial class Point
{
partial void MoveVertically(int z);
}
partial class Point
{
int x = 0;
int y = 0;
int z = 0;
partial void MoveVertically(int y) // Noncompliant
{
this.y = y;
}
}
interface IFoo
{
void Bar(int i);
}
class Foo : IFoo
{
void Bar(int z) // Noncompliant, parameter name should be i
{
}
}
Compliant solution
partial class Point
{
partial void MoveVertically(int z);
}
partial class Point
{
int x = 0;
int y = 0;
int z = 0;
partial void MoveVertically(int z)
{
this.z = z;
}
}
interface IFoo
{
void Bar(int i);
}
class Foo : IFoo
{
void Bar(int i)
{
}
}