Static class is 100% out. You can't get it done. However, there's probably no need for an actual static class here. You should instead use a normal class, register it as a singleton, and then inject it where you need it. The context is a scoped service, so you still cannot directly inject it into the class, but you can inject IServiceProvider
and use the service-locator pattern:
using var scope = _serviceProvider.CreateScope();
using var context = scope.ServiceProvider.GetRequiredService<MyContext>();
// do something with context
It's important to note that you can only use the context in within the scope of which it's defined. You cannot do something like a set a field or property on the class with it. You'll have to use the above code within each method that needs to use the context within the class.