public virtual void AcceptSolution(Answer answer) { lock (localLock) { if (acceptedAnswer == null) { acceptedAnswer = answer; AssignPointForAcceptingAnswer(); } else { throw new NotSupportedException("An answer has been already accepted"); } } }
public virtual void AcceptAnswer(Question question,Answer answer) { if (!question.IsOwner(this)) throw new NotSupportedException("An answer can be accepted only by the question's owner"); question.AcceptSolution(answer); }