diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec
index eaf178c..81e6caf 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).
* [Client] Improve connection stability (thanks to @jltjohanlindqvist).
* [ManagedClient] Fixed a memory leak (thanks to @zawodskoj).
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
-
+
+
+
+
+
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;
+ }
+ }
+}