Пример #1
0
        public async Task <IActionResult> PutPerson(int id, Person person)
        {
            if (id != person.personId)
            {
                return(BadRequest());
            }

            _context.Entry(person).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PersonExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
 public void Guncelle(Calisan calisan)
 {
     using (CrudDbContext db = new CrudDbContext())
     {
         db.Entry(calisan).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #3
0
 public ActionResult Edit(int id, Person person)
 {
     using(CrudDbContext db = new CrudDbContext())
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
     }
     return RedirectToAction("Index");
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "userID,first_name,last_name,date,gender,mobile,email,pswd,category")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Пример #5
0
 public void Guncelle(T entity)
 {
     dbSet.Attach(entity);
     db.Entry(entity).State = EntityState.Modified;
     db.SaveChanges();
 }