public IActionResult Deposit(Deposit deposit) { var rep = new DonorRepository(_connectionString); rep.AddDeposit(deposit); return(Redirect("/donor/index")); }
public IActionResult NewDonor(Donor donor, decimal amount) { var rep = new DonorRepository(_connectionString); rep.AddNewDonor(donor); var deposit = new Deposit { DonorId = donor.Id, Amount = amount, DepositDate = donor.DateCreated }; rep.AddDeposit(deposit); return(Redirect("/donor/index")); }