AssessmentAnywhere.Services.Assessments.Assessment.AddCandidate C# (CSharp) Метод

AddCandidate() публичный Метод

public AddCandidate ( string surname, string forenames ) : System.Guid
surname string
forenames string
Результат System.Guid
        public Guid AddCandidate(string surname, string forenames)
        {
            if (string.IsNullOrWhiteSpace(surname))
            {
                throw new ArgumentException("Surname must have a value.", "surname");
            }

            if (string.IsNullOrWhiteSpace(forenames))
            {
                throw new ArgumentException("Forenames must have a value.", "forenames");
            }

            var assessmentResult = new AssessmentResult(surname, forenames);
            if (this.results.Contains(assessmentResult))
            {
                throw new UniqueConstraintException(string.Format("A candidate with name \"{0}, {1}\" alread exists.", surname, forenames));
            }

            this.results.Add(assessmentResult);
            return assessmentResult.Id;
        }