Askme.Domain.Question.IsOwner C# (CSharp) Méthode

IsOwner() public méthode

public IsOwner ( User asker ) : bool
asker User
Résultat bool
        public virtual bool IsOwner(User asker)
        {
            return user.Equals(asker);
        }

Usage Example

Exemple #1
0
 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);
 }