You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Thinktecture.EntityFrameworkCore.SqlServer.Testing/EntityFrameworkCore/Testing/ITestIsolationOptions.cs
Copy file name to clipboardExpand all lines: src/Thinktecture.EntityFrameworkCore.SqlServer.Testing/EntityFrameworkCore/Testing/SqlServerDbContextIntegrationTests.cs
Copy file name to clipboardExpand all lines: src/Thinktecture.EntityFrameworkCore.SqlServer.Testing/EntityFrameworkCore/Testing/SqlServerTestDbContextProvider.cs
+43-13Lines changed: 43 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ public class SqlServerTestDbContextProvider<T> : ITestDbContextProvider<T>
/// Rollbacks transaction if shared tables are used
217
-
/// otherwise the migrations are rolled back and all tables, functions, views and the newly generated schema are deleted.
218
+
/// otherwise performs cleanup according to provided <see cref="ITestIsolationOptions"/>.
218
219
/// </summary>
219
220
publicvoidDispose()
220
221
{
222
+
if(_isDisposed)
223
+
return;
224
+
225
+
_isDisposed=true;
226
+
221
227
Dispose(true);
222
228
GC.SuppressFinalize(this);
223
229
}
224
230
231
+
/// <summary>
232
+
/// Rollbacks transaction if shared tables are used
233
+
/// otherwise performs cleanup according to provided <see cref="ITestIsolationOptions"/>.
234
+
/// </summary>
235
+
publicasyncValueTaskDisposeAsync()
236
+
{
237
+
if(_isDisposed)
238
+
return;
239
+
240
+
_isDisposed=true;
241
+
242
+
awaitDisposeAsync(true);
243
+
GC.SuppressFinalize(this);
244
+
}
245
+
225
246
/// <summary>
226
247
/// Disposes of inner resources.
227
248
/// </summary>
228
249
/// <param name="disposing">Indication whether this method is being called by the method <see cref="SqlServerTestDbContextProvider{T}.Dispose()"/>.</param>
/// <param name="disposing">Indication whether this method is being called by the method <see cref="SqlServerTestDbContextProvider{T}.Dispose()"/>.</param>
0 commit comments