Feb 29, 2012 10:40 AM|AlexERS|LINK
return ReadAndValidateName(out name) && ReadAndValidatePrice(out price);
Your methods will be called in the following order :
1. ReadAndValidateName will be called, and if it returns false, then ReadAndValidatePrice will not be called, because the final result is already clear, and does not depend on the result of the second method.2. If ReadAndValidateResult returns true, then the final result will depend on the result of ReadAndValidatePrice, so, it will be called also.If it is important for you that the both two methods were called anyway, regardless of their results (you need to get name and price values for further use), then use & instead of &&.
return ReadAndValidateName(out name) & ReadAndValidatePrice(out price);