public ActionResult PostWord([FromBody] WordDTO wordDTO)
        {
            wordsService.CreateWord(wordDTO);
            int wordId = 0;

            return(Created($"{Request.Path}/{wordId}", wordDTO));
        }
        public async override Task Execute(Message message, TelegramBotClient telegramBotClient)
        {
            ChatId  chatId   = message.Chat.Id;
            string  wordName = message.Text.Substring(message.Text.IndexOf(" ") + 1);
            WordDTO wordDTO  = new WordDTO();

            wordDTO.Name       = wordName;
            wordDTO.UserChatId = message.Chat.Id;
            wordsService.CreateWord(wordDTO);
            await telegramBotClient.SendTextMessageAsync(chatId, "word created");
        }
Example #3
0
 public IActionResult CreateWord([FromBody] Word newWord)
 {
     return(Ok(wordsService.CreateWord(newWord)));
 }