コード例 #1
0
ファイル: TopicsService.cs プロジェクト: las6731/homenotify
        public async Task <bool> removeTopic(string topic)
        {
            var result = await repository.DeleteTopicByName(topic);

            if (result == RepositoryResult.Success)
            {
                await messageService.SendMessage(new Message
                {
                    Topic = "topics",
                    Data  = new Dictionary <string, string>
                    {
                        { "unsubscribeTopic", topic }
                    }
                });
            }

            logger.LogInformation($"Topic {topic} " + (result.IsSuccess() ? "removed successfully." : "unable to be removed."));

            return(result.IsSuccess());
        }