public async Task <TEntity> Update(TEntity entity)
        {
            context.Entry(entity).State = EntityState.Modified;
            await context.SaveChangesAsync();

            return(entity);
        }
示例#2
0
        public ActionResult OkuyanGuncelle(Okuyan oky)
        {
            ctx.Entry(oky).State = EntityState.Modified;
            int sonuc = ctx.SaveChanges();

            if (sonuc > 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
示例#3
0
 public ActionResult KitapGuncelle(Kitap ktp)
 {
     if (ModelState.IsValid)
     {
         ctx.Entry(ktp).State = EntityState.Modified;
         int sonuc = ctx.SaveChanges();
         if (sonuc > 0)
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View());
 }