ToString
method should never return null
CS-R1011The ToString
method should return a string that best represents your class/object. Returning null
from such a method does not make any sense and is therefore recommended that you refactor this method to return a more suitable and appropriate representation.
class Point
{
public override string ToString()
{
return null;
}
}
class Point
{
public override string ToString()
{
return $"({x}, {y})";
}
}