Пример #1
0
 public ActionResult Edit([Bind(Include = "AddressId,UserId,ReceiverName,PhoneNumber,City,Address,PlateNumber,ZipCode,IdentificationCode")] Addresses addresses)
 {
     if (ModelState.IsValid)
     {
         db.Entry(addresses).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Users, "UserId", "UserName", addresses.UserId);
     return(View(addresses));
 }
Пример #2
0
 public virtual void Update(T obj)
 {
     _table.Attach(obj);
     _context.Entry(obj).State = EntityState.Modified;
 }