removed dead code and make new connection context an opt in so kestrel 2.0 still works

This commit is contained in:
JanEggers
2018-06-16 17:20:01 +02:00
parent d5ac8c7183
commit 7c2adf636f
4 changed files with 19 additions and 66 deletions
@@ -30,11 +30,19 @@ namespace MQTTnet.AspNetCore
if (options.DefaultEndpointOptions.IsEnabled)
{
services.AddSingleton<MqttConnectionHandler>();
services.AddSingleton<IMqttServerAdapter>(s => s.GetService<MqttConnectionHandler>());
services.AddSingleton<MqttTcpServerAdapter>();
services.AddSingleton<IMqttServerAdapter>(s => s.GetService<MqttTcpServerAdapter>());
}
return services;
}
public static IServiceCollection AddMqttConnectionHandler(this IServiceCollection services)
{
services.AddSingleton<MqttConnectionHandler>();
services.AddSingleton<IMqttServerAdapter>(s => s.GetService<MqttConnectionHandler>());
return services;
}
}
}