Skip to content

Commit 48e70d8

Browse files
committed
Better wiping of logged localization
1 parent 2809a79 commit 48e70d8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Test/StubClasses/StubDefaultLocalizerWithLogging.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using LocalizeMessagesAndErrors;
55
using Microsoft.EntityFrameworkCore;
66
using Microsoft.Extensions.Configuration;
7+
using TestSupport.EfHelpers;
78
using TestSupport.Helpers;
89

910
namespace Test.StubClasses;
@@ -193,11 +194,7 @@ public void WipeLocalizationCaptureDb()
193194
if (context == null)
194195
return;
195196

196-
if (context.Database.EnsureCreated())
197-
return;
198-
//The database exists so wipe the entries
199-
context.RemoveRange(context.LocalizedData?.ToList() ?? new List<LocalizedLog>());
200-
context.SaveChanges();
197+
context.Database.EnsureClean();
201198
}
202199

203200
public List<LocalizedLog> ListLocalizationCaptureDb()

0 commit comments

Comments
 (0)