File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) Atlas Lift Tech Inc. All rights reserved.
22
33using Microsoft . AspNetCore . Mvc ;
4+ using Microsoft . Extensions . DependencyInjection ;
5+ using Microsoft . Extensions . Logging ;
6+ using Microsoft . Extensions . Options ;
7+ using MQTTnet ;
8+ using MQTTnet . AspNetCore . AttributeRouting ;
49using MQTTnet . AspNetCore . AttributeRouting . Attributes ;
510using MQTTnet . AspNetCore . AttributeRouting . Routing ;
611using MQTTnet . Server ;
12+ using System ;
13+ using System . Collections . Generic ;
714using System . Linq ;
815using System . Threading . Tasks ;
916
@@ -80,5 +87,15 @@ public virtual Task BadMessage()
8087 MqttContext . ProcessPublish = false ;
8188 return Task . CompletedTask ;
8289 }
90+
91+ public T GetSessionItem < T > ( string key )
92+ {
93+ return ( T ) MqttContext . SessionItems [ key ] ;
94+ }
95+
96+ public T GetSessionItem < T > ( )
97+ {
98+ return ( T ) MqttContext . SessionItems [ nameof ( T ) ] ;
99+ }
83100 }
84101}
You can’t perform that action at this time.
0 commit comments