private static BotStateConfigurationBuilder UseBotState <TBotState>(BotStateConfigurationBuilder builder, Action <BotStateBuilder <TBotState> > configure)
            where TBotState : BotState
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var stateBuilder = new BotStateBuilder <TBotState>(builder);

            configure(stateBuilder);

            var botState = stateBuilder.Build();

            return(builder.UseBotState(botState));
        }
Exemplo n.º 2
0
 public static BotStateBuilder <TBotState> UseMemoryStorage <TBotState>(this BotStateBuilder <TBotState> builder)
     where TBotState : BotState =>
 builder.UseStorage(new MemoryStorage());