Example #1
0
        public async Task <IActionResult> Create([Bind("AppointmentId,FirstName,LastName,PhoneNumber,Date,Time")] Appointment appointment)
        {
            if (ModelState.IsValid)
            {
                db.Add(appointment);
                await db.SaveChangesAsync();

                return(RedirectToAction("thanks"));
            }
            return(View(appointment));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("QuestionId,Question")] DonorQuestion donorQuestion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(donorQuestion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(donorQuestion));
        }