public IActionResult Get() { try { var users = _repo.GetAllUsers(); return(Ok(Mapper.Map <IEnumerable <UserModel> >(users))); } catch (Exception ex) { _logger.LogError($"Threw exception while fetching users: {ex}"); } return(BadRequest("Could not fetch users")); }