Possible Duplicate:
Anyone know a good workaround for the lack of an enum generic constraint?
Can I use inheritance with an extension method?
I have created extensions methods for various enums to get their strings in certain format. Is there a simpler way to make the code looks smart so that I can just add the type and extension method should be created for that type.
public static string GetString(this State p1)
{
return p1.ToString("F");
}
public static string GetString(this Brand p1)
{
return p1.ToString("F");
}
public static string GetString(this Status p1)
{
return p1.ToString("F");
}
Thank you.