示例#1
0
        public IActionResult Get()
        {
            // get
            var responseBody = repository.Get(logPath);

            // response
            return(this.ContentResult(responseBody, HttpStatusCode.OK));
        }
示例#2
0
        public IActionResult Get(string log)
        {
            // get
            var(statusCode, responseBody) = repository.Get(logPath, log);

            // exit conditions
            if (statusCode == HttpStatusCode.NotFound)
            {
                return(NotFound(new { Message = $"Log [{log}] or configuration [{logPath}] were not found." }));
            }

            // response
            return(this.ContentTextResult(responseBody, HttpStatusCode.OK));
        }
示例#3
0
        public IActionResult Get(string log)
        {
            // get
            var(statusCode, responseBody) = repository.Get(logPath, log);

            // exit conditions
            if (statusCode == HttpStatusCode.NotFound)
            {
                return(NotFound(new { Message = $"Log [{log}] or configuration [{logPath}] were not found." }));
            }

            // response
            return(new ContentResult
            {
                Content = responseBody,
                ContentType = MediaTypeNames.Text.Plain,
                StatusCode = HttpStatusCode.OK.ToInt32()
            });
        }