Skip to content

Commit

Permalink
Fixed database deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMi-Ha committed Apr 23, 2024
1 parent 09317bd commit 51da594
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions PWManager.Data/DataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ public void DeleteDataContext() {
if (_dbContext is null) {
return;
}
var path = _dbContext.Path;

_dbContext.Database.EnsureDeleted();

CloseDatabase();
try {
File.Delete(path);
}
catch (IOException) {
throw new UserFeedbackException(MessageStrings.CANNOT_DELETE_DATABASE);
}
}

ApplicationDbContext IHaveDataContext.GetDbContext() {
Expand Down

0 comments on commit 51da594

Please sign in to comment.