We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c3e2b6 commit 4f28cb7Copy full SHA for 4f28cb7
src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Repository.cs
@@ -78,10 +78,10 @@ public async ValueTask StoreAsync(TEntity entity)
78
79
public async ValueTask DeleteAsync(string id)
80
{
81
- await using var blogDbContext = await dbContextFactory.CreateDbContextAsync();
82
var entityToDelete = await GetByIdAsync(id);
83
if (entityToDelete != null)
84
+ await using var blogDbContext = await dbContextFactory.CreateDbContextAsync();
85
blogDbContext.Remove(entityToDelete);
86
await blogDbContext.SaveChangesAsync();
87
}
0 commit comments