Beispiel #1
0
        public async Task DeleteMetaTags(params string[] tagsToDelete)
        {
            var articleContext = await _getArticleContextWorkflow.GetArticleContext();

            if (articleContext == null)
            {
                return;
            }

            var tagRequests = tagsToDelete.Select(tag => new MetaTagRequest
            {
                Name = tag
            }).ToArray();

            var metaRequestLink = articleContext.GetApiLink(LinkRelValueObject.META_TAG);
            var response        = await _client.DeleteMessage(metaRequestLink, tagRequests);
        }
Beispiel #2
0
        public async Task MarkArticleAsDeleted()
        {
            var articleContext = await _getArticleContextWorkflow.GetArticleContext();

            if (articleContext == null)
            {
                return;
            }

            var deleteResponse = await _client.DeleteMessage(articleContext.GetSelfApiLink());

            if (!deleteResponse.IsSuccessStatusCode)
            {
                throw new HttpRequestException($"failed HTTP request: {deleteResponse.StatusCode}\n{deleteResponse.ReasonPhrase}");
            }

            await _updateArticleContextWorkflow.GetAndUpdateArticleContext(articleContext);
        }