I have the following method calls:
var types = CityTypeExt.GetOptions();
var statuses = CityStatusExt.GetOptions();
and the following methods:
public static class CityTypeExt
{
public static SelectList GetOptions()
{
var values = EnumUtilities.GetSpacedOptions<CityType>();
var options = new SelectList(values, "Value", "Text");
return options;
}
}
public static class CityStatusExt
{
public static SelectList GetOptions()
{
var values = EnumUtilities.GetSpacedOptions<CityStatus>();
var options = new SelectList(values, "Value", "Text");
return options;
}
}
Is there a way I could make a generic method that would combine CityTypeExt and CityStatusExt ?
Note that CityType and CityStatus are Enums.
Try this: