-2
我想使行不活動而不是刪除它們。無效行而不是刪除
我目前的代碼刪除了字符。相反,我想列IsActive設置爲0(假)
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
Character character = db.Characters.Find(id);
db.Characters.Remove(character);
db.SaveChanges();
return RedirectToAction("Index");
}
表定義:
CharacterID int
isActive bit
UserId uniqueidentifier
你需要改變:character.IsActive = false; – MataHari 2012-07-07 01:16:08