public IActionResult Get() { //exception handling try { List <User> list = _context.GetAllDetails(); if (list.Count != 0) { return(Ok(list)); } else { return(StatusCode(404)); } } catch { return(StatusCode(500)); } }