/*** Methods ***/ public Donation MakeDonation(Guid donorId) { var donor = _donorStorage.GetById(donorId); var newDonation = new Donation() { Donor = donor, DonationDate = DateTime.Now, Id = Guid.NewGuid() }; donor.Donate(); _donationStorage.Create(newDonation); return(newDonation); }
public Donation MakeDonation(Guid donorId) { var donor = _donorStorage.GetById(donorId); // Create the new donation var newDonation = new Donation() { Donor = donor, DonationDate = DateTime.Now, Id = Guid.NewGuid() }; // Updating properties donor.Donate(); // Store the donation _donations.Add(newDonation); // 3.3: This should be replaced with an interface return(newDonation); }