예제 #1
0
        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)));
            }
        }
예제 #2
0
        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);
        }