We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtain UserId from AuthenticationMiddleware, so that EntityFramework can write Audit Information to Database
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken()) { foreach (var entry in ChangeTracker.Entries<AuditableEntity>()) { switch (entry.State) { case EntityState.Added: entry.Entity.CreatedBy = _CurrentUserService.UserId; entry.Entity.Created = DateTime.Now; break; case EntityState.Modified: entry.Entity.LastModifiedBy = _CurrentUserService.UserId; entry.Entity.LastModified = DateTime.Now; break; } } return base.SaveChangesAsync(cancellationToken); }
The text was updated successfully, but these errors were encountered:
eimerreis
No branches or pull requests
Obtain UserId from AuthenticationMiddleware, so that EntityFramework can write Audit Information to Database
The text was updated successfully, but these errors were encountered: