I created a .NET Framework web application with MVC as the link instructs, and I've created the classes described in the above link (also, what's the right folder to put them in? I put them in "models").
The guide doesn't tell me how to make the web application USE these classes, though. How do I do that? My approach was to remove the auto-generated classes for ApplicationUser and ApplicationUserManager and replace all references to CognitoUser and CognitoUserManager,
which I suspect isn't the right way. It now throws an exception within AccountController:
System.InvalidOperationException: 'The model backing the 'ApplicationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).'
But am I using the User/UserManager classes in the intended way? The Amazon link doesn't say anything about using DB tables or EF entities. As far as I can tell, that's just something that the MVC wizard created, and is more or less hiding the accessing
mechanism from me.
I have a feeling that if I have to go down this rabbit hole, when there's no mention of it in the guide I'm trying to follow, then I must have done something wrong.
None
0 Points
14 Posts
How do I use these User/UserManager classes?
Aug 23, 2018 07:22 PM|jlisonbidmc|LINK
I've been following this guide:
https://aws.amazon.com/blogs/mobile/use-csharp-to-register-and-authenticate-with-amazon-cognito-user-pools/
I created a .NET Framework web application with MVC as the link instructs, and I've created the classes described in the above link (also, what's the right folder to put them in? I put them in "models").
The guide doesn't tell me how to make the web application USE these classes, though. How do I do that? My approach was to remove the auto-generated classes for ApplicationUser and ApplicationUserManager and replace all references to CognitoUser and CognitoUserManager, which I suspect isn't the right way. It now throws an exception within AccountController:
System.InvalidOperationException: 'The model backing the 'ApplicationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).'
All-Star
18265 Points
3594 Posts
Microsoft
Re: How do I use these User/UserManager classes?
Aug 24, 2018 08:26 AM|Nan Yu|LINK
Hi jlisonbidmc ,
This error means your DB tables and EF Entities are not match , you can try below solutions:
If you already deployed your application or you don't want remove data from database you must read about Code First Migrations. Here you have a link: https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index
Deleting the __MigrationHistory table in SQL Server .
In addition , for how to use Amazon Cognito libraries , you can post question to AWS support .
Best Regards,
Nan Yu
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue.
None
0 Points
14 Posts
Re: How do I use these User/UserManager classes?
Aug 24, 2018 12:54 PM|jlisonbidmc|LINK
But am I using the User/UserManager classes in the intended way? The Amazon link doesn't say anything about using DB tables or EF entities. As far as I can tell, that's just something that the MVC wizard created, and is more or less hiding the accessing mechanism from me.
I have a feeling that if I have to go down this rabbit hole, when there's no mention of it in the guide I'm trying to follow, then I must have done something wrong.