コード例 #1
0
ファイル: Student.cs プロジェクト: Dochko/SoftUni
        public bool IsOlderThan(IStudent other)
        {
            try
            {
                DateTime firstStudentBirthday = this.GetBirthday(this.AdditionalInfo);
                DateTime secondStudentBirthday = other.GetBirthday(other.AdditionalInfo);

                return firstStudentBirthday < secondStudentBirthday;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw new ArgumentException("One or both students do not have valid date of birth information provided.");
            }
        }