Exemple #1
0
        public async Task <ActionResult> Edit([Bind(Include = "UserId,Email")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Entry(user).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(user));
        }
Exemple #2
0
        public async Task <ActionResult> Edit([Bind(Include = "PreferenceId,Occasions,UserPreference,Flowers,UserId")] Preference preference)
        {
            if (ModelState.IsValid)
            {
                db.Entry(preference).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.UserId = new SelectList(db.Users, "UserId", "Email", preference.UserId);
            return(View(preference));
        }