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

_roleManager.DeleteAsync => NOT WORKING #1630


User avatar
0
sferrari created

Hi, I'm trying to delete a role, does not give me any error of fact the result is success = true, but the role is not deleted, the code attached. Thank you


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    disabling softDelete filter only works for getting records. It does not delete record from database.

    If you want to completly delete records from database, you have two options.

    1 ) write a custom repository for role and execute regular sql query in it. 2) Override CancelDeletionForSoftDelete method of AbpDbContext and put your logic in it. For example you can check if softDelete filter is disabled and exit from method if it is. <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/ab6697f5a047e3a0ea74c01b163a629953d0a389/src/Abp.EntityFramework/EntityFramework/AbpDbContext.cs#L396">https://github.com/aspnetboilerplate/as ... xt.cs#L396</a>

  • User Avatar
    0
    sferrari created

    Thanks !!!!! :D :D :D :D