Example #1
0
        public async Task <IActionResult> Create(DonorDto donorDto)
        {
            if (donorDto == null)
            {
                throw new ArgumentNullException(nameof(donorDto));
            }
            if (ModelState.IsValid)
            {
                donorService.AddDonor(mapper.Map <Models.Donor>(donorDto));
                await donorService.SaveChangesAsync();

                return(RedirectToAction("DonorComplete"));
            }
            return(View(donorDto));
        }