You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
I'm receiving the error below when I try to change a user's password using the Microsoft.AspNet.Identity.AspNetCoreCompat project.
An exception of type 'System.ArgumentException' occurred in EntityFramework.dll but was not handled in user code
Additional information: The property 'ConcurrencyToken' on type 'ApplicationUser' is not a primitive or complex property. The Property method can only be used with primitive or complex properties. Use the Reference or Collection method.
There is no ConcurrencyToken property in the IdentityUser class. Changing the line to entityEntry.Property("ConcurrencyStamp").CurrentValue = Guid.NewGuid().ToString(); fixed the error.
And I had to convert the Guid to string since the type of the ConcurrencyStamp property is string.
How to replicate:
Create an ASP.NET MVC 4.6.1 application with Individual User Accounts
Reference the AspNet.Identity.CoreCompat assembly
Change the ApplicationUser class to inherit from the Microsoft.AspNet.Identity.CoreCompat.IdentityUser
Change the ApplicationDbContext class to inherit from the Microsoft.AspNet.Identity.CoreCompat.IdentityDbContext
Run the application
Create a user and try to change the password
The text was updated successfully, but these errors were encountered:
@HaoKOnModelCreating() refers to ConcurrencyStamp but ValidateEntity() refers to ConcurrencyToken as string so I guess it is just a typo. FWIW, you can use lambdas in ValidateEntity() 😄
Hi,
I'm receiving the error below when I try to change a user's password using the Microsoft.AspNet.Identity.AspNetCoreCompat project.
The cause is in the line https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNet.Identity.AspNetCoreCompat/IdentityDbContext.cs#L129.
There is no ConcurrencyToken property in the IdentityUser class. Changing the line to
entityEntry.Property("ConcurrencyStamp").CurrentValue = Guid.NewGuid().ToString();
fixed the error.And I had to convert the Guid to string since the type of the ConcurrencyStamp property is string.
How to replicate:
The text was updated successfully, but these errors were encountered: