我正在尝试使用Async和Await方法实现Login方法:
public async System.Threading.Tasks.Task<ActionResult> Login(Models.Login login, string returnUrl)
{
try
{
if (!ModelState.IsValid)
{
return View(login);
}
var result = await SignInManager.PasswordSignInAsync<UserLoginInfo,string>(login.EmailID, login.Password);
switch(result)
{
case SignInStatus.Success:
return RedirectToAction("Account", "Privacy");
case SignInStatus.RequiresVerification:
return RedirectToAction("SendUrl", new { ReturnUrl=returnUrl });
case SignInStatus.Failure:
default:
ModelState.AddModelError("", "Invalid login attempt.");
return View(login);
}
}
catch (Exception)
{
throw;
}
// return View();
}
出现此错误:
错误CS0305使用通用类型'SignInManager'需要2个类型参数