public IActionResult GetSession(string sessionid) { Session session = sessionContext.FindSession(sessionid); if (session == null) { logger.LogInformation($"Session Not Found: {sessionid}"); return(NotFound()); } else { logger.LogInformation($"Session Found OK: {sessionid}"); return(Ok(JsonConvert.SerializeObject(session, Formatting.Indented))); } }
public HttpResponseMessage GetSession(string sessionid) { HttpResponseMessage response = new HttpResponseMessage(); Session session = sessionContext.FindSession(sessionid); if (session == null) { response.StatusCode = HttpStatusCode.NotFound; } else { response.StatusCode = HttpStatusCode.OK; response.Content = new StringContent(JsonConvert.SerializeObject(session)); } return(response); }