public IActionResult Login([Bind] User user) { result = dao.CheckLogin(user); if (result != null) { HttpContext.Session.SetString("User", result.Name); HttpContext.Session.SetString("Username", result.Username); HttpContext.Session.SetString("Role", result.Role); HttpContext.Session.SetString("Email", result.Email); return(Json("success")); } else { return(Json("failed")); } }
public void LoginTest() { Assert.IsNotNull(dao.CheckLogin(user)); }