Class MongoDbTrackingExtensions
Extension methods for tracking external collections in the database monitor. Use this when a package registers its own collection types via DI but needs them to appear in the monitor as "in code" rather than "NotInCode".
public static class MongoDbTrackingExtensions
- Inheritance
-
MongoDbTrackingExtensions
- Inherited Members
Methods
TrackMongoCollection(IServiceCollection, Type, Type)
Tracks a collection type so the database monitor recognises it as registered in code.
This does NOT register the type in DI — only tells the monitor about it.
Can be called before or after AddMongoDB; the actual merge happens in UseMongoDB.
public static IServiceCollection TrackMongoCollection(this IServiceCollection services, Type serviceType, Type implementationType)
Parameters
servicesIServiceCollectionThe service collection.
serviceTypeTypeThe collection interface type.
implementationTypeTypeThe collection implementation type.
Returns
TrackMongoCollection<TService, TImplementation>(IServiceCollection)
Tracks a collection type so the database monitor recognises it as registered in code. Generic convenience overload.
public static IServiceCollection TrackMongoCollection<TService, TImplementation>(this IServiceCollection services)
Parameters
servicesIServiceCollection
Returns
Type Parameters
TServiceThe collection interface type.
TImplementationThe collection implementation type.