S
shapper
Hello,
I have a class and method as follows:
public class ErrorService {
Error GetError(errorId) { ... }
void Mapping() { ... }
}
I would like the Mapping mathod to be "invisible" to other classes.
And the GetError method to be "visible" to other classes and able to
access it as follows:
Error myError = ErrorService.GetError(1);
Without creating an instance of "ErrorService".
What is the correct way to do this? Using static in GetError and keep
Mapping as it is?
And should I also add public to GetError and private to Mapping?
Thanks,
Miguel
I have a class and method as follows:
public class ErrorService {
Error GetError(errorId) { ... }
void Mapping() { ... }
}
I would like the Mapping mathod to be "invisible" to other classes.
And the GetError method to be "visible" to other classes and able to
access it as follows:
Error myError = ErrorService.GetError(1);
Without creating an instance of "ErrorService".
What is the correct way to do this? Using static in GetError and keep
Mapping as it is?
And should I also add public to GetError and private to Mapping?
Thanks,
Miguel