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