什么是软删除集成? [关闭]

As my client asked me to integrate soft delete on his web application. But I have never done this, please help me out.

A soft delete is when you mark a record as deleted instead of deleting the record from the table.

To implement this you need another field in the table, for example named Deleted. Use a bit/boolean field and set it to 0 or false (depending on what database you use) when you create the record (and on existing records).

To delete a record you just change the value in that field. Example:

update
  SomeTable
set
  Deleted = 1
where
  Id = @Id

Wherever you use that table you have to filter out the deleted records (unless they should actually be shown anyway). Example:

select
  SomeField
from
  SomeTable
where
  Deleted = 0