Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to hard delete? #2135

Closed
tky753 opened this issue Nov 10, 2019 · 1 comment
Closed

how to hard delete? #2135

tky753 opened this issue Nov 10, 2019 · 1 comment

Comments

@tky753
Copy link

tky753 commented Nov 10, 2019

I tried

using (_dataFilter.Disable<ISoftDelete>())
{
     await repository.DeleteAsync(entity);
     await CurrentUnitOfWork.SaveChangesAsync()
}

It doesn't work.

Maybe because

//\abp\framework\src\Volo.Abp.EntityFrameworkCore\Volo\Abp\EntityFrameworkCore\AbpDbContext.cs
protected virtual void CancelDeletionForSoftDelete(EntityEntry entry)
{
    if (!(entry.Entity is ISoftDelete))
    {
        return;
    }

    entry.Reload();
    entry.State = EntityState.Modified;
    entry.Entity.As<ISoftDelete>().IsDeleted = true;
}
@hikalkan
Copy link
Member

Data filter system is for filtering data on querying. It has no effect on changing the database.

We had implemented a similar feature for ASP.NET Boilerplate before and planned for this framework too. See #139

Until it's implemented, you can use SQL to delete it for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants