Set ConcurrencyStamp current value using lambdas.

This commit is contained in:
Fabiano França 2016-12-14 08:36:54 -02:00 committed by Hao Kung
parent 830a1863a1
commit d4d105d5b5
1 changed files with 2 additions and 2 deletions

View File

@ -126,11 +126,11 @@ namespace Microsoft.AspNet.Identity.CoreCompat
{ {
if (entityEntry.Entity is TUser && entityEntry.State == EntityState.Modified) if (entityEntry.Entity is TUser && entityEntry.State == EntityState.Modified)
{ {
entityEntry.Property("ConcurrencyStamp").CurrentValue = Guid.NewGuid().ToString(); entityEntry.Cast<TUser>().Property(p => p.ConcurrencyStamp).CurrentValue = Guid.NewGuid().ToString();
} }
else if (entityEntry.Entity is TRole && entityEntry.State == EntityState.Modified) else if (entityEntry.Entity is TRole && entityEntry.State == EntityState.Modified)
{ {
entityEntry.Property("ConcurrencyStamp").CurrentValue = Guid.NewGuid().ToString(); entityEntry.Cast<TRole>().Property(p => p.ConcurrencyStamp).CurrentValue = Guid.NewGuid().ToString();
} }
return base.ValidateEntity(entityEntry, items); return base.ValidateEntity(entityEntry, items);
} }