我想停用行而不是删除它们。
我当前的代码删除了该字符。相反,我想将列 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