LLBLGen: How can I softdelete a entry

后端 未结 3 1073
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 12:41

I have inherited a project that uses LLBLGen Pro for the DB layer. The DB model requires that when a entry is deleted a flag (DeletedDate is set to the current time). The last p

3条回答
  •  迷失自我
    2021-02-10 13:28

    It depends if you are using self-servicing or adapter. If SS you will need to modify the template so that it sets the flag for you rather than deleting the entity.

    If adapter, you can inherit from DataAccessAdapter and override the delete methods to set the flag for you rather than deleting the entities.

    It's generally a crappy solution for performace though as every query then needs to filter out "deleted" entities - and because the selectvity on the "deleted" column won't be very high (all of your "undelted" records are null - i'm guessing this will be the majority of them) indexing it doesn't gain you a great deal - you will end up with a lot of table scans.

提交回复
热议问题