I am trying to create a migration, that would purge data for the whole schema and then run migrations. I have found a way to run the migrations for the context set only. I cannot find a way to delete the data in the given context, and not in the whole database.
Current code for migrations only:
var context = scope.ServiceProvider.GetRequiredService<TContext>();
await context.Database.MigrateAsync();
context.Database.EnsureDeleted(); has allowed me to delete the database before running migrations, but it seems to ignore the context I provide (as it says in the documentation).
Any ideas on how to delete data in the context?
Thanks!