Base solution for your next web application
Open Closed

How to disable SoftDelete and have a Audit or History table? #4673


User avatar
0
manojreddy created

Hi,

For some reason and requirement, I want to disable the SoftDelete feature. Means Row should be deleted from the table on delete.

The second requirement is to have an Audit or History table like I want to see the full history for a table for Update and Delete Records without writing DB Triggers, So that I can see all the deleted records and old velues of records.


6 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    1- If you need to, you can disable pre-defined filters globally. For example, to disable the soft-delete filter globally, add this code to the PreInitialize method of your module:

    Configuration.UnitOfWork.OverrideFilter(AbpDataFilters.SoftDelete, false);
    

    2- Entity audit history is a new feature in Asp.Net Boilerplate. To get this feature you need to update the ABP to the latest. <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Entity-History">https://aspnetboilerplate.com/Pages/Doc ... ty-History</a>

  • User Avatar
    0
    manojreddy created

    @alper thanks for your quick reply.

    How to disable SoftDelete at Entity level?

    Which version shall I upgrade to for audit/history table?

  • User Avatar
    0
    ismcagdas created
    Support Team

    You can disable filters as explained here <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Data-Filters#disable-filters">https://aspnetboilerplate.com/Pages/Doc ... le-filters</a>. You need ABP v3.4 for Entity History feature.

  • User Avatar
    0
    manojreddy created

    Which project version shall I download from [https://aspnetzero.com/Download])?

    How can I check my existing project version?

  • User Avatar
    0
    manojreddy created

    Thanks for your replies guys.

    I have followed the steps mentioned in the below document to implement Entity History, But it's not working.

    [https://aspnetboilerplate.com/Pages/Documents/Entity-History])

    I have posted my implementation here.

    [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=10806])

    [https://stackoverflow.com/questions/48761496/not-able-to-implement-entity-history-in-abp-framework])

  • User Avatar
    0
    ismcagdas created
    Support Team

    Resolved here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/818#issuecomment-365233656">https://github.com/aspnetzero/aspnet-ze ... -365233656</a>.