Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Commit

Permalink
Set ConcurrencyStamp current value using lambdas.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiano authored and HaoK committed Jan 4, 2017
1 parent 830a186 commit d4d105d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ protected override DbEntityValidationResult ValidateEntity(DbEntityEntry entityE
{
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)
{
entityEntry.Property("ConcurrencyStamp").CurrentValue = Guid.NewGuid().ToString();
entityEntry.Cast<TRole>().Property(p => p.ConcurrencyStamp).CurrentValue = Guid.NewGuid().ToString();
}
return base.ValidateEntity(entityEntry, items);
}
Expand Down

0 comments on commit d4d105d

Please sign in to comment.