persistence/Persistence.IntegrationTests/Extensions/EFCoreExtensions.cs

16 lines
385 B
C#
Raw Normal View History

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