AddDbContext method for DI

Does this need to be on the DbContext class and does it need to be internal? It seems like it could be separated out and be a normal public method, either as a service or as a static method if making it a normal service doesn't make sense because of the time it is called in the pipeline.