问题
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