public bool UpdateDonor(Donor donor) { Donor dataDonor = entities.Donors.SingleOrDefault(d => d.DonorID == donor.DonorID); if (dataDonor != null) { dataDonor.Email = donor.Email; dataDonor.FirstName = donor.FirstName; dataDonor.LastName = donor.LastName; int updated = entities.SaveChanges(); return (updated > 0); } return false; }
public Donor CreateDonor(Donor donor) { entities.Donors.Add(donor); int newID = entities.SaveChanges(); return donor; }