I have the following enum declared outside all the classes and namespaces in my project:
public enum ServerType { Database, Web } // there are more but omitted for brevity
I want to override the ToString()
method with something like:
public override string ToString(ServerType ServerType)
{
switch (ServerType)
{
case ServerType.Database:
return "Database server";
case ServerType.Web:
return "Web server";
}
// other ones, just use the base method
return ServerType.ToString();
}
However I get an error no suitable method found to override
Is it possible to override the enum when converting to string with my own method?