私のアプリケーションは、電子メールの検証を実行して、ユーザーに電子メールを送信しています。ユーザーがリンクをクリックすると、次のアクションが呼び出されます。
[AllowAnonymous]
public ActionResult RegisterConfirmation(string Id) //Id=ConfirmationToken
{
if (WebSecurity.ConfirmAccount(Id))
{
//get userId and perfom some operations related to it
return RedirectToAction("ConfirmationSuccess");
}
return RedirectToAction("ConfirmationFailure");
}
私の質問は:
ConfirmationToken を使用して userId を取得するにはどうすればよいですか?
私は使用SimpleMembershipProvider
しており、データベースコンテキストにアクセスできます。