I'm trying to overload the method below because I don't want to pass a null for the optional parameter. So I read online that I could let overloads call each other. I was following this example:
Is passing null in to a method acceptable
[HttpGet]
public ActionResult TesMethod (int? testID, int employeeID)
{
Excel excel = new Excel();
excel.CreateExport(null, int employeeID);
return RedirectToAction("Index", "Employee");
}
[HttpGet]
public ActionResult TesMethod (int employeeID)
{
Excel excel = new Excel();
excel.CreateExport(int employeeID);
return RedirectToAction("Index", "Employee");
}
I would like one method to take the optional parameter int? testID and the other method to not take the optional parameter. How can I do this?
Any help is very much appreciated it.