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'"); }
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); }
private void SetBloodType(BloodType bloodType) { BloodType = bloodType ?? throw new ArgumentNullException($"{nameof(bloodType)} can't be null."); }