public ActionResult Edit([Bind(Include = "Id,Name")] Destination destination)
 {
     if (ModelState.IsValid)
     {
         db.Entry(destination).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(destination));
 }
コード例 #2
0
 public bool Add(TEntity entity)
 {
     _dbSet.Add(entity);
     return(Context.SaveChanges() > 0);
 }