public static IServiceCollection RegisterNodeApi(this IServiceCollection services) { services.AddTransient <INodeApiInfrastructureService, NodeApiInfrastructureService>(); services.AddTransient <INodeApiInfrastructureService, NodeApiInfrastructureService>(); MySqlModule.LoadSqlRepository <IHeartbeatRepository, HeartbeatRepository, HeartbeatContext>(services); return(services); }
private static IServiceCollection RegisterTemperatureListenerInfrastructureService(this IServiceCollection collection) { collection.AddTransient <ITemperatureListenerInfrastructureService, TemperatureListenerInfrastructureService>(); MySqlModule.LoadSqlRepository <ITemperatureRepository, TemperatureRepository, TemperatureContext>(collection); return(collection); }
private static IServiceCollection RegisterHeartbeatListenerInfrastructureService(this IServiceCollection collection) { collection.AddTransient <IHeartbeatListenerInfrastructureService, HeartbeatListenerInfrastructureService>(); MySqlModule.LoadSqlRepository <IHeartbeatRepository, HeartbeatRepository, HeartbeatContext>(collection); return(collection); }
private static IServiceCollection RegisterPlaneListenerInfrastructureService(this IServiceCollection collection) { collection.AddTransient <IPlaneListenerInfrastructureService, PlaneListenerInfrastructureService>(); RedisModule.LoadRedisRepository <IPlaneCacheRepository, PlaneCacheRepository, PlaneCacheContext>(collection); MySqlModule.LoadSqlRepository <IPlaneFrameMetadataRepository, PlaneFrameMetadataRepository, ReadWriteContext>(collection); return(collection); }
private static IServiceCollection RegisterLifeAlertInfrastructureService(this IServiceCollection collection) { collection.AddTransient <ILifeAlertInfrastructureService, LifeAlertInfrastructureService>(); collection.AddSingleton <IEmailConfiguration, EmailConfigurationProvider>(); MySqlModule.LoadSqlRepository <IHeartbeatRepository, HeartbeatRepository, HeartbeatContext>(collection); return(collection); }
private static void RegisterServices() { var services = new ServiceCollection(); configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetParent(AppContext.BaseDirectory).FullName) .AddJsonFile("appsettings.json", false) .Build(); services.AddSingleton <IConfiguration>(configuration); MySqlModule.LoadSqlRepository <ITestRepository, TestRepository, ReadWriteContext>(services); _serviceProvider = services.BuildServiceProvider(); }