How to mark items as deleted not originally delete from database?
Define a new column of
bit
type in your database for ever record in a table.
Bit field will hold either
true
or
false
. By default, set this flag value as
false
to indicate active and valid. Once you delete it from frontend, set this field to '
true
' to mark as deleted.
Now, during data retrieval from DB, use this field as one of the WHERE clause condition, ex:
-- IsDelete is the BIT field defined
SELECT * FROM myTable WHERE IsDelete = false