My project has the Delete method, but it definitely deletes the record from the table in the database.
I would like to instead of delete, change the column record, I have a field called "Status", this field is an Enum with two options "Enabled = 0" and "Off = 1", by default it is "Enabled" .
How to change his method for it to change rather than delete?
In MySql I would use this command to change:
update pessoas set Status = 1 where (Id = 1);
On Controller Delete is like this:
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int id)
{
Pessoas pessoas = db.Pessoas.Find(id);
db.Pessoas.Remove(pessoas);
db.SaveChanges();
return RedirectToAction("Index");
}