From fd8caed9af961e7fc0351774b9b1c8e369557c9d Mon Sep 17 00:00:00 2001 From: Graham Watts Date: Sat, 22 Feb 2020 11:25:01 +0200 Subject: [PATCH 1/3] Add .NET 3.1 target Add .NET Core 3.1 target that uses ASP.NET Core framework reference instead of NuGet package references --- Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj b/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj index 86db749..c0768b4 100644 --- a/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj +++ b/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp2.1 + netstandard2.0;netcoreapp2.1;netcoreapp3.1 @@ -14,7 +14,11 @@ RELEASE;NETSTANDARD2_0 - + + + + + From 5f59aca62c46210efb68e8afdbe71b20aa4268da Mon Sep 17 00:00:00 2001 From: Dominik Viererbe Date: Tue, 25 Feb 2020 16:30:08 +0100 Subject: [PATCH 2/3] Added MqttClientUnsubscribeOptionsBuilder analogous to MqttClientSubscribeOptionsBuilder --- .../MqttClientUnsubscribeOptionsBuilder.cs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Source/MQTTnet/Client/Unsubscribing/MqttClientUnsubscribeOptionsBuilder.cs diff --git a/Source/MQTTnet/Client/Unsubscribing/MqttClientUnsubscribeOptionsBuilder.cs b/Source/MQTTnet/Client/Unsubscribing/MqttClientUnsubscribeOptionsBuilder.cs new file mode 100644 index 0000000..96c178f --- /dev/null +++ b/Source/MQTTnet/Client/Unsubscribing/MqttClientUnsubscribeOptionsBuilder.cs @@ -0,0 +1,60 @@ +using MQTTnet.Packets; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MQTTnet.Client.Unsubscribing +{ + public class MqttClientUnsubscribeOptionsBuilder + { + private readonly MqttClientUnsubscribeOptions _unsubscribeOptions = new MqttClientUnsubscribeOptions(); + + public MqttClientUnsubscribeOptionsBuilder WithUserProperty(string name, string value) + { + if (name is null) throw new ArgumentNullException(nameof(name)); + if (value is null) throw new ArgumentNullException(nameof(value)); + + return WithUserProperty(new MqttUserProperty(name, value)); + } + + public MqttClientUnsubscribeOptionsBuilder WithUserProperty(MqttUserProperty userProperty) + { + if (userProperty is null) throw new ArgumentNullException(nameof(userProperty)); + + if (_unsubscribeOptions.UserProperties is null) + { + _unsubscribeOptions.UserProperties = new List(); + } + + _unsubscribeOptions.UserProperties.Add(userProperty); + + return this; + } + + public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(string topic) + { + if (topic is null) throw new ArgumentNullException(nameof(topic)); + + if (_unsubscribeOptions.TopicFilters is null) + { + _unsubscribeOptions.TopicFilters = new List(); + } + + _unsubscribeOptions.TopicFilters.Add(topic); + + return this; + } + + public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(TopicFilter topicFilter) + { + if (topicFilter is null) throw new ArgumentNullException(nameof(topicFilter)); + + return WithTopic(topicFilter.Topic); + } + + public MqttClientUnsubscribeOptions Build() + { + return _unsubscribeOptions; + } + } +} From a20c845a5ac52a3c090adef0e494ef25fa0b1ae4 Mon Sep 17 00:00:00 2001 From: Dominik Viererbe Date: Mon, 9 Mar 2020 18:27:35 +0100 Subject: [PATCH 3/3] Update MQTTnet.nuspec --- Build/MQTTnet.nuspec | 1 + 1 file changed, 1 insertion(+) diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec index 963ee06..ba32a42 100644 --- a/Build/MQTTnet.nuspec +++ b/Build/MQTTnet.nuspec @@ -11,6 +11,7 @@ false MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker) and supports v3.1.0, v3.1.1 and v5.0.0 of the MQTT protocol. +* [ManagedClient] Added builder class for MqttClientUnsubscribeOptions (thanks to @dominikviererbe). * [ManagedClient] Added support for persisted sessions (thansk to @PMExtra). * [Server] Added support for assigned client IDs (MQTTv5 only) (thanks to @bcrosnier).