public bool IsValid()
{
get { return (GetRuleViolations().Count() == 0); }
}
I’m getting this error:
; expected
What is wrong?
I’m following this tutorial: http://nerddinnerbook.s3.amazonaws.com/Part3.htm
I’m not sure why they are using get.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need parentheses after IsValid, since it’s a property not a method (presumably, since you’re using a getter)
Write it like this:
Alternatively, if IsValid were a method, it could look like this: