c# - Identity 2.0 issues - MVC 5 -
i'm starting use identity in asp .net mvc 5 , have questions
1) function of "identity_userid" column. in tables appear (userroles, userlogins, , userclaims), "null". has fk relationship users table.
https://user-images.githubusercontent.com/11781418/28696307-2c65235c-730b-11e7-8593-530f87c03ba2.jpg
2) why await usermanager.getloginsasync (user.identity.getuserid()); returns 0? have registered user , have linked 2 external accounts (facebook , google)
public async task<actionresult> managelogins(managemessageid? message) { viewbag.statusmessage = message == managemessageid.removeloginsuccess ? "the external login removed." : message == managemessageid.error ? "an error has occurred." : ""; var user = await usermanager.findbyidasync(user.identity.getuserid()); if (user == null) { return view("error"); } var userlogins = await usermanager.getloginsasync(user.identity.getuserid()); var otherlogins = authenticationmanager.getexternalauthenticationtypes().where(auth => userlogins.all(ul => auth.authenticationtype != ul.loginprovider)).tolist(); viewbag.showremovebutton = user.passwordhash != null || userlogins.count > 1; return view(new manageloginsviewmodel { currentlogins = userlogins, otherlogins = otherlogins }); }
https://user-images.githubusercontent.com/11781418/28696311-3163ccbe-730b-11e7-86bc-f611b6998fbd.jpg
thx!
Comments
Post a Comment