public async Task <IActionResult> Create([Bind("Id,Subject,Topic,SchoolType,Experience,StudyDate,AddressLine1,AddressLine2,City,State,Country,ZipCode")] Request request) { if (ModelState.IsValid) { _context.Add(request); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(request)); }
public async Task <IActionResult> Create([Bind("Id,Username,Password,FirstName,LastName,Gender,Dob,Email,StreetAddress,City,Country,ZipCode,Phone")] Users users) { if (ModelState.IsValid) { _context.Add(users); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(users)); }
public async Task <IActionResult> Index(ContactUs contactUs) { if (ModelState.IsValid) { _context.Add(contactUs); await _context.SaveChangesAsync(); return(View("ContactUsForm", contactUs)); } else { return(View()); } }