public async Task <ActionResult> Create([Bind(Include = "UserId,Email")] User user) { if (ModelState.IsValid) { db.Users.Add(user); await db.SaveChangesAsync(); return(RedirectToAction("Create", "Preferences")); } return(View(user)); }
public async Task <ActionResult> Create([Bind(Include = "PreferenceId,Occasions,UserPreference,Flowers,UserId")] Preference preference) { if (ModelState.IsValid) { db.Preferences.Add(preference); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "UserId", "Email", preference.UserId); return(View(preference)); }