With extension method, it is possible to add function that you call an instance.
public static class MyExtensions
{
public static bool MyNewExtension(this String s)
{
return true;
}
}
...
string s = "";
s.MyNewExtension();
I don’t think it is possible to add a static method extension like this?
String.MyNewExtension(s)
It is most likely a dummy idea.
My use case is that in .NET 8 some static methods were added and I am in .NET 6 ; so I would like to create those static methods to be able to write the same code as in .NET 8 but without doing the whole migration.