EF Not finding columns
I'm trying to create an API for my database using the IdentityManager,
when simply wanting to grab all my users from the database using my controller I get this error:
"message": "Invalid column name 'ConcurrencyStamp'.\r\nInvalid column name 'LockoutEnd'.\r\nInvalid column name 'NormalizedEmail'.\r\nInvalid column name 'NormalizedUserName'."
Ive checked the database and its columns and those columns are present. Im not really sure where else I should look.
Ive applied the correct table name to the modelBuilder.13 Replies
`
If your context inherits from
IdentityDbContext
you don't need to set up a new dbset or to configure the user table in any way
Could be that it creates some conflictIve removed that but the error remains the same as the one mentioned above
I assume you created a new migration, yeah?
If so, and the error still occurs, try nuking migrations and the database and create a new migration from that point
This is off a pre-existing database which I cant really edit
At least not for now
This database is used in an older project, our other developer said it would be supported by Identity
I was kind of just hoping I could ignore the unused columns
Wait, it's an existing database, but has it been created in a code-first way?
There is migration history
But that migration hasnt been done by me
Huh
Was the dbcontext already inheriting from
IdentityContext
?yea
Then you shouldn't have needed to make any changes
The users should just have been available from the context, like that
Thats what I thought too, but yet I remain getting these errors
I know it has some corellation with my custom User class
Because that error above was without these properties, but when adding them back they also become a part of the problem
That was my old class which I knew it wouldnt have the related columns so that was just for checking
but even with nothing there
I just cant seem to figure out why it gives those erros
errors*