예제 #1
0
        public JsonResult AddUrlKey(string caption, string url, string botId)
        {
            if (string.IsNullOrEmpty(caption))
            {
                return(Json(false));
            }
            if (string.IsNullOrEmpty(url))
            {
                return(Json(false));
            }
            if (string.IsNullOrEmpty(botId))
            {
                return(Json(false));
            }

            var inlineKeyDto = _inlineUrlKeysRepository.AddInlineUrlKey(new InlineUrlKey
            {
                Caption = caption,
                Url     = url,
                BotId   = botId
            });

            return(inlineKeyDto != null
                                ? Json(inlineKeyDto.Transform())
                                : Json(false));
        }
예제 #2
0
        public IActionResult AddInlineUrlKey(string caption, string url, string botId)
        {
            _inlineUrlKeysRepository.AddInlineUrlKey(new InlineUrlKey
            {
                Caption = caption,
                Url     = url,
                BotId   = botId
            });

            return(Redirect("/bot?id=" + botId));
        }