Try pattern
A method that returns true or false for success and hands the result back through out.
The Try pattern (bool TryX(..., out T result)) reports an expected failure through its return value instead of throwing, as int.TryParse does.
Examples
bool TryGetDiscount(string code, out decimal percent)returns false for an unknown code instead of throwing.
See also