I am exploring MVC Identity 2.x. I have followed the sample in
Using Entity Framework Implementation of ASP.NET Identity 2 for PostgreSQL https://www.devart.com/dotconnect/postg ... ntity.html
and all seems to work fine.
I would like to use the same credentials within an accompanying winforms app. I have successfully implemented login and check the credentials using the following code
Code: Select all
Public Function VerifyUserNamePassword(ByVal userName As String, ByVal password As String) As Boolean
Dim usermanager = New UserManager(Of IdentityUser)(New UserStore(Of IdentityUser)(New IdentityDbContext("DefaultConnectionTwo")))
Return usermanager.Find(userName, password) IsNot Nothing
End Function
Code: Select all
Dim usermanager = New UserManager(Of IdentityUser)(New UserStore(Of IdentityUser)(New IdentityDbContext("DefaultConnectionTwo")))
Dim newuser As New ApplicationUser
newuser.Email = TextBox3.Text
newuser.UserName = TextBox3.Text
MessageBox.Show(usermanager.Create(newuser, TextBox4.Text).ToString)
I have imported the models from the mvc project, but not the controllers. I suspect this is the issue, but not quite sure how to achieve it.
Is is possible to do what i am trying to do, if so , how do i modify my project to be able to add users.
I will post a sample project
many thanks
Nick