Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string SomeFunction(string param1, int param2)
- {
- if(string.IsNullOrEmpty(param1)){
- throw new ArgumentException("bla", "param1");
- }
- if(param2 < 0 || param2 > 100 || param2 == 53)
- {
- throw new ArgumentOutOfRangeException("eek", "param2");
- }
- }
- public string SomeFunction(string param1, int param2)
- {
- CheckParameterNotNull(param1);
- CheckParameterRange(param2, 0, 100, 53);
- ...
- }
- private string InternalSomeFunction(string param1, int param2)
- {
- /* implementation goes here */
- }
- public string SomeFunction(string param1, int param2)
- {
- if (string.IsNullOrEmpty(param1)) {
- throw new ArgumentException("bla", "param1");
- }
- if (param2 < 0 || param2 > 100 || param2 == 53) {
- throw new ArgumentOutOfRangeException("eek", "param2");
- }
- return InternalSomeFunction(param1, param2);
- }
- if (IsFormValid)
- {
- // Processing Magic Goes here.
- }
Add Comment
Please, Sign In to add comment