MVC4 application: Does anyone know what could cause this? In the Login ActionResult, ThisUserId returns -1 when should return the UserId from the UserProfile table (SimpleMembership).
int ThisUserId = WebSecurity.GetUserId(User.Identity.Name);
This started after I accidentally modified the UserProfile table as follows:
public override void Up()
{
CreateTable(
"dbo.UserPresentation",
c => new
{
UserPresentationId = c.Int(nullable: false, identity: true),
IsActive = c.Boolean(nullable: false),
UserId = c.Int(nullable: false),
PresentationId = c.Int(nullable: false),
})
.PrimaryKey(t => t.UserPresentationId);
AddColumn(&qu ...
Go to the complete details ...