示例#1
0
        public IActionResult GetAll()
        {
            // Assume the user is not authorized
            IActionResult result = Unauthorized();

            try
            {
                var visits = _db.GetVisits();
                result = Ok(visits);
            }
            catch (Exception)
            {
                result = BadRequest(new { Message = "Get visit failed." });
            }

            return(result);
        }