0
我剛開始學習MVC。您能否詳細解釋如何:列出所有用戶,刪除/創建用戶並編輯有關用戶的信息。現在我的HomeController看起來是這樣的:MVC 5中的用戶列表Asp.NET
private ApplicationSignInManager _signInManager;
private ApplicationUserManager _userManager;
public HomeController()
{
}
public HomeController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
{
UserManager = userManager;
SignInManager = signInManager;
}
public ApplicationSignInManager SignInManager
{
get
{
return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
}
private set
{
_signInManager = value;
}
}
public ApplicationUserManager UserManager
{
get
{
return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
}
private set
{
_userManager = value;
}
}
public ActionResult Index()
{
var us = UserManager.Users.ToList();
return View(us);
}
我看到了,但我實際上不明白,如何適應我的任務。 – BrSystem
如果您在理解教程時遇到困難,那麼請專注於提供問題和研究的領域,並在理解之前瞭解這些想法 –
在本教程中,我們創建了用戶,但我如何與標準用戶在asp.net註冊? – BrSystem