2024-12-10 11:27:22 +05:00
|
|
|
|
using Persistence.Database;
|
|
|
|
|
using Persistence.Database.Model;
|
2024-11-26 12:27:52 +05:00
|
|
|
|
|
|
|
|
|
namespace Persistence.IntegrationTests.Extensions;
|
|
|
|
|
|
|
|
|
|
public static class EFCoreExtensions
|
2024-12-10 11:27:22 +05:00
|
|
|
|
{
|
|
|
|
|
public static void CleanupDbSet<T>(this PersistenceDbContext dbContext)
|
2024-11-26 12:27:52 +05:00
|
|
|
|
where T : class
|
|
|
|
|
{
|
|
|
|
|
var dbset = dbContext.Set<T>();
|
|
|
|
|
dbset.RemoveRange(dbset);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|