birbmap/Birdmap.API/Options/AspCoreMqttClientOptions.cs

23 lines
519 B
C#
Raw Normal View History

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