Hi, some questions about web methods in .Net and best practice
I have two made up to explain my point, one that can throw an exception and one that never does.
void AddEmployee(String employeeFirstName, String employeeSecondName, int age);
int GetEmployeeAgeOrNegative1IfNotFound(String employeeFirstName, String employeeSecondName);
My question is do I handle the exception for every web method in the client with loads of try/catch blocks or to I return magic numbers or an error code somehow? The silly method GetEmployeeAgeOrNegative1IfNotFound never throws an exception but returns a magic number of -1 and AddEmployee might throw an exception for many reasons.
How do people do this & what is the best practice here?