public IHttpActionResult logInUser(JObject userInfo) { User user = new JavaScriptSerializer().Deserialize <User>(userInfo.ToString()); User userLogged = userManager.LogIn(user); if (userLogged != null) { return(Ok(userLogged)); } else { return(BadRequest()); } }