Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

how to add IsDeleted = true to all entities? #7852


User avatar
0
wcdagency created

hello

In whole system, If I delete an entity, It deletes completely from the database. But what I would like to do is, I dont want any entity to be deleted, I want to add a property, les say, IsDeleted Or IsPassive, whatever, so , when it is first created and not deleted, IsDeleted=false or IsPassive=false, when It is deleted , I want to set this property IsDeleted=true.

how would I accomplish it?

Do I have to create a custom IRepository? how?


2 Answer(s)
  • User Avatar
    0
    yekalkan created

    See soft deletion: https://aspnetboilerplate.com/Pages/Documents/Entities#soft-delete

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can use ISoftDelete