Beispiel #1
0
        public IActionResult Content(Guid id)
        {
            using (_databaseContextFactory.Create())
            {
                var documentContent = _documentQuery.FindContent(id);

                if (documentContent == null)
                {
                    return(BadRequest($"Could not find a document with id '{id}'."));
                }

                if (documentContent.Content == null)
                {
                    return(BadRequest($"The content for document with id '{id}' is not yet available."));
                }

                Response.Headers.Add("sanitized-content", HasBeenSanitized(documentContent));

                return(Ok(new
                {
                    Data = documentContent.Content
                }));
            }
        }