コード例 #1
0
        public IActionResult ClearBot()
        {
            lexUserSession = HttpContext.Session;

            lexUserSession.Clear();
            chatBotMessages = new List <ChatBotMessage>();
            lexSessionData  = new Dictionary <string, string>();

            lexUserSession.Set <List <ChatBotMessage> >(botMsgKey, chatBotMessages);
            lexUserSession.Set <Dictionary <string, string> >(botAttribsKey, lexSessionData);

            awsLexSvc.Dispose();
            return(View("ChatView", chatBotMessages));
        }
コード例 #2
0
        public IActionResult ClearBot()
        {
            _userHttpSession = HttpContext.Session;

            _userHttpSession.Clear();

            _botMessages    = new List <ChatBotMessage>();
            _lexSessionData = new Dictionary <string, string>();

            _userHttpSession.Set(_botMsgKey, _botMessages);
            _userHttpSession.Set(_botAtrribsKey, _lexSessionData);

            _awsLexService.Dispose();
            return(View(nameof(Index), _botMessages));
        }
コード例 #3
0
        public IActionResult ClearBot()
        {
            userHttpSession = HttpContext.Session;

            //Clear session keys and session information without removing Session ID
            userHttpSession.Clear();

            //New botMessages and lexSessionData objects
            botMessages    = new List <ChatBotMessage>();
            lexSessionData = new Dictionary <string, string>();

            userHttpSession.Set <List <ChatBotMessage> >(botMsgKey, botMessages);
            userHttpSession.Set <Dictionary <string, string> >(botAtrribsKey, lexSessionData);

            awsLexSvc.Dispose();
            return(View("TestChat", botMessages));
        }
コード例 #4
0
 public IActionResult ClearBot()
 {
     botMessages.RemoveRange(0, botMessages.Count);
     awsLexSvc.Dispose();
     return(View("TestChat", botMessages));
 }