DbContextHelper.SaveChanges() 方法执行baseSaveChanges() 后是否异步执行SaveScope()?

Does the DbContextHelper.SaveChanges() method carry out the SaveScope() asynchronously after performing baseSaveChanges()?

我想澄清一下 AuditContext 中的 SaveScope() 是否在 base.SaveChages() 之后 异步执行 以避免正常操作被阻塞? ??

如果没有,有什么方法可以实现该要求......???

不,如果您调用 EF DbContext 的 SaveChanges(),将在数据库上运行操作后保存审计,并且对审计数据提供程序的调用将是同步的。

否则,如果您调用 SaveChangesAsync(),对审计数据提供程序的调用将是异步的。

如果您需要不同的行为,您可以在方便的时候实现自己的 data provider, inheriting from the base AuditDataProvider or from an existing data provider