private static void AddDefaultServices( IServiceCollection collection, IDroneServerEnviroment enviroment, IConfiguration configuration) { if (collection is null) { throw new ArgumentNullException(nameof(collection)); } if (enviroment is null) { throw new ArgumentNullException(nameof(enviroment)); } if (configuration is null) { throw new ArgumentNullException(nameof(configuration)); } collection.AddSettingsWithDB(configuration); collection.AddDroneContexts(enviroment); collection.AddLoopWorkers(); collection.AddMovement(); collection.AddPidRegulators(); collection.AddGlobalExceptionCatching(); collection.AddStabilization(); }
public static IServiceCollection AddDroneContexts(this IServiceCollection collection, IDroneServerEnviroment enviroment) { collection.TryAddSingleton <IDroneServerContext, DroneServerContext>(); collection.TryAddSingleton(enviroment); return(collection); }
public GenericDroneServerHostBuilder(IHostBuilder builder) { _builder = builder ?? throw new ArgumentNullException(nameof(builder)); Enviroment = new DroneServerEnviroment(); }
public DroneServerContext(IMovementSource movementSource, IDroneServerEnviroment enviroment, IServiceProvider provider) { MovementSource = movementSource ?? throw new ArgumentNullException(nameof(movementSource)); Enviroment = enviroment ?? throw new ArgumentNullException(nameof(enviroment)); Provider = provider ?? throw new ArgumentNullException(nameof(provider)); }