persistence/Persistence.IntegrationTests/Extensions/EFCoreExtensions.cs

15 lines
319 B
C#
Raw Normal View History

using Persistence.Database.Model;
namespace Persistence.IntegrationTests.Extensions;
public static class EFCoreExtensions
{
public static void CleanupDbSet<T>(this PersistenceDbContext dbContext)
where T : class
{
var dbset = dbContext.Set<T>();
dbset.RemoveRange(dbset);
dbContext.SaveChanges();
}
}