26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using Microsoft.Extensions.DependencyInjection;
 | |
| using Microsoft.Extensions.Options;
 | |
| using StellaOps.Vexer.Storage.Mongo.Migrations;
 | |
| 
 | |
| namespace StellaOps.Vexer.Storage.Mongo;
 | |
| 
 | |
| public static class VexMongoServiceCollectionExtensions
 | |
| {
 | |
|     public static IServiceCollection AddVexerMongoStorage(this IServiceCollection services)
 | |
|     {
 | |
|         services.AddOptions<VexMongoStorageOptions>();
 | |
| 
 | |
|         services.AddSingleton<IVexRawStore, MongoVexRawStore>();
 | |
|         services.AddSingleton<IVexExportStore, MongoVexExportStore>();
 | |
|         services.AddSingleton<IVexProviderStore, MongoVexProviderStore>();
 | |
|         services.AddSingleton<IVexConsensusStore, MongoVexConsensusStore>();
 | |
|         services.AddSingleton<IVexCacheIndex, MongoVexCacheIndex>();
 | |
|         services.AddSingleton<IVexCacheMaintenance, MongoVexCacheMaintenance>();
 | |
|         services.AddSingleton<IVexConnectorStateRepository, MongoVexConnectorStateRepository>();
 | |
|         services.AddSingleton<IVexMongoMigration, VexInitialIndexMigration>();
 | |
|         services.AddSingleton<VexMongoMigrationRunner>();
 | |
|         services.AddHostedService<VexMongoMigrationHostedService>();
 | |
|         return services;
 | |
|     }
 | |
| }
 |