public IActionResult Get() { // get var responseBody = repository.Get(logPath); // response return(this.ContentResult(responseBody, HttpStatusCode.OK)); }
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)); }
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() }); }