2024-11-18 14:22:09 +05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
2024-12-16 15:38:46 +05:00
|
|
|
|
namespace DD.Persistence.IntegrationTests;
|
2024-11-18 14:22:09 +05:00
|
|
|
|
public static class EFCoreExtensions
|
|
|
|
|
{
|
|
|
|
|
public static void CleanupDbSet<T>(this DbContext dbContext)
|
|
|
|
|
where T : class
|
|
|
|
|
{
|
|
|
|
|
var dbset = dbContext.Set<T>();
|
|
|
|
|
dbset.RemoveRange(dbset);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|