public async Task <IActionResult> Create([Bind("UserId,Name")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("EmailID,ElectonicMail,isActive,UserId")] Email email) { if (ModelState.IsValid) { _context.Add(email); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Set <User>(), "UserId", "UserId", email.UserId); return(View(email)); }
public async Task <IActionResult> Create([Bind("PhoneId,LandLineNumber,MobileNumber,isUsingWhatsApp,UserId")] Phone phone) { if (ModelState.IsValid) { _context.Add(phone); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Set <User>(), "UserId", "UserId", phone.UserId); return(View(phone)); }
public async Task <IActionResult> Create([Bind("AddrId,HouseNO,Street,State,PostalCode,Country,UserId")] Address address) { if (ModelState.IsValid) { _context.Add(address); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.Set <User>(), "UserId", "UserId", address.UserId); return(View(address)); }