MVC4 UserProfiles has no results after logging in

ε祈祈猫儿з 提交于 2019-12-11 05:28:31

问题


On the new MVC4 it uses SimpleMembership which when logging in contains the line:

if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))

After this I did the following to get the extended properties I applied to the UserProfile:

var context = new UsersContext();
var user = context.UserProfiles.First(n => n.UserName == model.UserName);

But UserProfiles has no results and has a count of 0 from context??? There must be something in there as I'm logging in with a user?

来源:https://stackoverflow.com/questions/12586289/mvc4-userprofiles-has-no-results-after-logging-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!