public async Task <IActionResult> Post([FromBody] MessageDTO data) { if (_messageCommands.CheckBotCommand(data.TextMessage)) { var botMessage = await _messageQueries.GetBotResponse(data.TextMessage.ToLower()); var option = new MessageDTO { UserEmail = "*****@*****.**", TextMessage = botMessage, Date = DateTime.Now, User = new UserDTO { FirstName = "Bot", Email = "*****@*****.**" } }; return(Ok(option)); } var userDTO = await _userQueries.GetByEmail(data.UserEmail); if (userDTO is null) { return(NotFound()); } data.UserId = userDTO.Id; data.Date = DateTime.Now; await _messageCommands.Insert(data); await _messageCommands.Save(); data.User = userDTO; return(Ok(data)); }