We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5101a9a commit 340ec0eCopy full SHA for 340ec0e
1 file changed
SQLite.CodeFirst/DbInitializers/SqliteDropCreateDatabaseWhenModelChanges.cs
@@ -87,25 +87,12 @@ public override void InitializeDatabase(TContext context)
87
}
88
89
90
- private void DeleteDatabase(TContext context, string databseFilePath)
+ private static void DeleteDatabase(TContext context, string databseFilePath)
91
{
92
context.Database.Connection.Close();
93
GC.Collect();
94
-
95
- // TODO: Comment
96
- for (int i = 0; i < 5; i++)
97
- {
98
- try
99
100
- File.Delete(databseFilePath);
101
- // TODO: Throw exception if 5 tries..
102
- break;
103
- }
104
- catch (Exception)
105
106
- System.Threading.Thread.Sleep(1);
107
108
+ GC.WaitForPendingFinalizers();
+ File.Delete(databseFilePath);
109
110
111
private void SaveHistory(TContext context)
0 commit comments