For sake of simplicity, let's assume I want to write an extension method for the type int? and int:
public static class IntExtentions
{
public static int AddOne(this int? number)
{
var dummy = 0;
if (number != null)
dummy = (int)number;
return dummy.AddOne();
}
public static int AddOne(this int number)
{
return number + 1;
}
}
Can this be done using only 1 method?