Пример #1
0
        public async Task <bool> DeleteConversationAsync(ConversationDTO conversationDTO)
        {
            var conversation = _conversationParser.ParseConversation(conversationDTO);

            if (conversation is PrivateConversation)
            {
                return(await _conversationRepository.DeleteConversationAsync((PrivateConversation)conversation));
            }
            else
            {
                return(await _conversationRepository.DeleteConversationAsync((GroupConversation)conversation));
            }
        }
Пример #2
0
        public async Task <ActionResult> DeleteConversation(int id)
        {
            var conv = await _conversationRepository.GetConversationByIdAsync(id);

            if (conv == null)
            {
                return(NotFound());
            }
            else
            {
                await _conversationRepository.DeleteConversationAsync(conv);

                return(NoContent());
            }
        }