BotSharp/src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs

25 lines
523 B
C#
Raw Normal View History

2023-09-03 22:43:50 +00:00
using BotSharp.Abstraction.Repositories.Models;
2023-08-09 21:49:55 +00:00
namespace BotSharp.Abstraction.Conversations.Models;
public class ConversationState : Dictionary<string, string>
{
2023-09-03 22:43:50 +00:00
public ConversationState()
{
}
public ConversationState(List<KeyValueModel> pairs)
{
foreach (var pair in pairs)
{
this[pair.Key] = pair.Value;
}
}
2023-09-08 17:17:54 +00:00
public List<KeyValueModel> ToKeyValueList()
{
return this.Select(x => new KeyValueModel(x.Key, x.Value)).ToList();
}
2023-08-09 21:49:55 +00:00
}