Ejemplo n.º 1
0
        /*** 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);
        }
Ejemplo n.º 2
0
        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);
        }