コード例 #1
0
 public BloodDonation(Guid id, DateTime dateOfDonation, int volume,
                      BloodType bloodType, Donor donor, Personnel bloodTaker)
 {
     Id             = id;
     DateOfDonation = dateOfDonation;
     Volume         = volume;
     BloodType      = bloodType ?? throw new ArgumentNullException($"{nameof(bloodType)} can't be null'");
     Donor          = donor ?? throw new ArgumentNullException($"{nameof(donor)} can't be null'");
     BloodTaker     = bloodTaker ?? throw new ArgumentNullException($"{nameof(bloodTaker)} can't be null'");
 }
コード例 #2
0
        public Donor(string pesel, string password, string salt,
                     string name, BloodType bloodType, string mail, string phone)
        {
            SetPesel(pesel);
            SetPassword(password, salt);
            SetName(name);

            LastDonated = null;

            SetBloodType(bloodType);
            SetMail(mail);
            SetPhone(phone);
        }
コード例 #3
0
 private void SetBloodType(BloodType bloodType)
 {
     BloodType = bloodType ?? throw new ArgumentNullException($"{nameof(bloodType)} can't be null.");
 }