AspNet.Identity.PostgreSQL icon indicating copy to clipboard operation
AspNet.Identity.PostgreSQL copied to clipboard

The type or namespace name 'IdentityUserLogin' could not be found

Open neway003 opened this issue 10 years ago • 0 comments

MVC 5.2.3 AspNet.WebApi 5.2.3

Visual Studio 2015 Community Edition

Error --------------------- foreach (IdentityUserLogin linkedAccount in user.Logins)----------------------

The above section in the below code inside "Controllers\AccountController.CS" shows an error "The type or namespace name 'IdentityUserLogin' could not be found "

------------------- Controllers\AccountController.CS -- GetManageInfo() -------------------

    // GET api/Account/ManageInfo?returnUrl=%2F&generateState=true
    [Route("ManageInfo")]
    public async Task<ManageInfoViewModel> GetManageInfo(string returnUrl, bool generateState = false)
    {
        IdentityUser user = await UserManager.FindByIdAsync(User.Identity.GetUserId());

        if (user == null)
        {
            return null;
        }

        List<UserLoginInfoViewModel> logins = new List<UserLoginInfoViewModel>();

        foreach (IdentityUserLogin linkedAccount in user.Logins)
        {
            logins.Add(new UserLoginInfoViewModel
            {
                LoginProvider = linkedAccount.LoginProvider,
                ProviderKey = linkedAccount.ProviderKey
            });
        }

neway003 avatar Nov 25 '15 08:11 neway003