コード例 #1
0
        public ActionResult SaveDonor(Donor donor)
        {
            if (!Session.IsSignedIn())
            {
                return(Json(new { saved = false }));
            }

            if (!donorService.IsValidDonor(donor, out var cause))
            {
                return(Json(new { saved = false, cause }));
            }

            var saved = donorService.CreateDonor(donor);

            return(Json(new { saved }));
        }