コード例 #1
0
        public void SetName(IEnumerable <BigInteger> prior, string firstName, string lastName)
        {
            var priorNames = Names.Where(n => prior.Contains(n.HashCodeInt));

            if (priorNames.Count() == 1 && NameEquals(priorNames.Single(), firstName, lastName))
            {
                return;
            }

            var newName = new MathematicianName(priorNames, firstName, lastName);

            if (Names.Any(n => n.HashCodeInt == newName.HashCodeInt))
            {
                return;
            }

            Names.Add(newName);
        }
コード例 #2
0
 private bool NameEquals(MathematicianName prior, string firstName, string lastName)
 {
     return(prior.FirstName == firstName && prior.LastName == lastName);
 }