fixed core 3.1 startup and verified it still works with 2.1 and net461

This commit is contained in:
JanEggers
2020-03-15 14:43:59 +01:00
parent f6a814c6d7
commit 20eda96921
14 changed files with 102 additions and 34 deletions
@@ -0,0 +1,21 @@
#if NETCOREAPP3_1
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
namespace MQTTnet.AspNetCore
{
public static class EndpointRouterExtensions
{
public static void MapMqtt(this IEndpointRouteBuilder endpoints, string pattern)
{
endpoints.MapConnectionHandler<MqttConnectionHandler>(pattern, options =>
{
options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol;
});
}
}
}
#endif