using Microsoft.Extensions.DependencyInjection; namespace Store.Modules.CloudProduct.Services; public class GoodsViolationIndexJob(IServiceScopeFactory scopeFactory) { public async Task ProcessPendingAsync() { using var scope = scopeFactory.CreateScope(); await scope.ServiceProvider.GetRequiredService() .DeleteViolationIndexesAsync(); } }