I have the following code:
public string GetResponse()
{
string fileName = this.Page.Request.PathInfo;
fileName = fileName.Remove(0, fileName.LastIndexOf("/") + 1);
switch (fileName)
{
case "GetEmployees":
return GetEmployees();
default:
return "";
}
}
public string GetEmployees()
{
I will have many of these. They will all return a string and want to know if there is a way to avoid the switch case. If there is, is there a way to return "Not Found" if the method does not exist?
Thanks