コード例 #1
0
        public async Task <ActionResult> Edit([Bind(Include = "ContactPhoneId,PhoneNumber,Type,ContactId")] ContactPhone contactPhone, string RedirectUrl)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contactPhone).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(Redirect(RedirectUrl));
            }
            return(View(contactPhone));
        }
コード例 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "ContactId,Name,Address,City,State,Zip,Email,Twitter")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contact).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", "Home", null));
            }
            return(View(contact));
        }