예제 #1
0
        public void DeleteChatTest()
        {
            try
            {
                var chats = Client.CurrentUsersChats();

                if (chats != null && chats.Chats.Count > 0)
                {
                    var firstChat = chats.Chats.FirstOrDefault();

                    if (firstChat != null)
                    {
                        DeleteChatRequest request = new DeleteChatRequest()
                        {
                            ChatIden = firstChat.Iden
                        };

                        Client.DeleteChat(request);
                    }
                }
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
예제 #2
0
 public IActionResult Delete([FromQuery] DeleteChatRequest request)
 {
     try
     {
         this.chatRepository.DeleteChat(request.ChatIdentifier);
         return(Ok());
     }
     catch (ChatNotFoundException ex)
     {
         this.logger.LogWarning(ex.Message);
         return(NotFound());
     }
 }