I am trying to create an extension method but can't get it to work.
So this works, create extension method on a Type of enum example:
public enum Pets
{
....
}
Above Pets can be extended creating an extension method like:
public static void Myex(this Pets pet)
{
...
}
But when I try to extend Enum itself example below:
Public static void something(this Enum en)
{
...
}
And try to use it like below
Enum.something();
this doesn't work.
I was trying to create similar method like Enum.Parse, Enum.IsDefined (which are already exposed by c#).