birbmap/Birdmap.BLL/Options/MqttClientOptions.cs

23 lines
498 B
C#
Raw Normal View History

2020-11-09 18:12:07 +01:00
using MQTTnet.Client.Options;
using System;
namespace Birdmap.BLL.Options
2020-11-09 18:12:07 +01:00
{
2021-01-16 15:23:10 +01:00
public class MqttClientOptions : MqttClientOptionsBuilder
2020-11-09 18:12:07 +01:00
{
public IServiceProvider ServiceProvider { get; }
2021-01-16 15:23:10 +01:00
public MqttClientOptions(IServiceProvider serviceProvider)
2020-11-09 18:12:07 +01:00
{
ServiceProvider = serviceProvider;
}
2021-01-16 15:23:10 +01:00
public MqttClientOptions WithTopic(string topic)
2020-11-09 18:12:07 +01:00
{
WithUserProperty("Topic", topic);
return this;
}
}
}