Пример #1
0
        private WordPressResult CreatePost(PodcastPost podcastPost)
        {
            Console.Write("Creating WordPress post...  ");
            _logger.Info("Beginning creation of post");

            WordPressResult result = _podcastService.CreatePodcastPost(podcastPost);

            if (result.IsSuccess)
            {
                Console.WriteLine($"Success! (Id = {result.Id})");
                Console.WriteLine($"The URL of the new post is:\n{result.Url}");
                _logger.Info($"Post creation succeeded - id = {result.Id}");
                _logger.Info($"Post URL = {result.Url}");
            }
            else
            {
                Console.WriteLine("Oh dear, it didn't work - here is the error: ");
                Console.WriteLine(result.ErrorMessage);
                Console.WriteLine("See the log file for more details...");
            }

            return(result);
        }