public void Logout() { try { int UserID = Convert.ToInt32(User.Claims.First(c => c.Type == "UserID").Value); _login.Logout(UserID); } catch { BadRequest(new { message = "User is not logged in." }); } }