@@ -27,7 +27,6 @@ public class ConversationStateService : IConversationStateService, IDisposable
27
27
private readonly ILogger _logger ;
28
28
private readonly IServiceProvider _services ;
29
29
private readonly IBotSharpRepository _db ;
30
- private readonly IConversationSideCar _sidecar ;
31
30
private string _conversationId ;
32
31
/// <summary>
33
32
/// States in the current round of conversation
@@ -41,12 +40,10 @@ public class ConversationStateService : IConversationStateService, IDisposable
41
40
public ConversationStateService (
42
41
IServiceProvider services ,
43
42
IBotSharpRepository db ,
44
- IConversationSideCar sidecar ,
45
43
ILogger < ConversationStateService > logger )
46
44
{
47
45
_services = services ;
48
46
_db = db ;
49
- _sidecar = sidecar ;
50
47
_logger = logger ;
51
48
_curStates = new ConversationState ( ) ;
52
49
_historyStates = new ConversationState ( ) ;
@@ -142,8 +139,9 @@ public Dictionary<string, string> Load(string conversationId, bool isReadOnly =
142
139
_conversationId = ! isReadOnly ? conversationId : null ;
143
140
Reset ( ) ;
144
141
142
+ var sidecar = _services . GetService < IConversationSideCar > ( ) ;
145
143
var endNodes = new Dictionary < string , string > ( ) ;
146
- if ( _sidecar ? . IsEnabled ( ) == true )
144
+ if ( sidecar ? . IsEnabled ( ) == true )
147
145
{
148
146
return endNodes ;
149
147
}
@@ -219,7 +217,8 @@ public Dictionary<string, string> Load(string conversationId, bool isReadOnly =
219
217
220
218
public void Save ( )
221
219
{
222
- if ( _conversationId == null || _sidecar ? . IsEnabled ( ) == true )
220
+ var sidecar = _services . GetService < IConversationSideCar > ( ) ;
221
+ if ( _conversationId == null || sidecar ? . IsEnabled ( ) == true )
223
222
{
224
223
Reset ( ) ;
225
224
return ;
0 commit comments