Skip to content
New issue

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

EntityHistory - AbpDbContext don't save changes #10527

Closed
totpero opened this issue Nov 5, 2021 · 4 comments · Fixed by #10570
Closed

EntityHistory - AbpDbContext don't save changes #10527

totpero opened this issue Nov 5, 2021 · 4 comments · Fixed by #10570
Assignees
Milestone

Comments

@totpero
Copy link
Contributor

totpero commented Nov 5, 2021

  • Your ABP Framework version.
  • 4.4.3
  • Your User Interface type (Angular/MVC/React... etc.) if the issue is related to a specific UI
  • Blazor Server
  • Your database provider(EF Core/MongoDB)
  • EF Core

Hi,
I fallow the documentation steps (https://docs.abp.io/en/abp/4.4/Audit-Logging) to activate EntityHistory for all my entities options.EntityHistorySelectors.AddAllEntities(); but when I try to save some changes nothing happens.
After few debug scenarios i found that the "AuditingManager.Current" is null here

I have set the UseAuditing() in my blazor module and
Configure(options =>
{
options.IsEnabled = true;
options.EntityHistorySelectors.AddAllEntities();
});

Why AuditingManager.Current is null?

@maliming
Copy link
Member

maliming commented Nov 5, 2021

Are you using blazor wasm or blazor server?

@totpero
Copy link
Contributor Author

totpero commented Nov 5, 2021

blazor server

@maliming maliming self-assigned this Nov 8, 2021
@maliming maliming added this to the 5.0-preview milestone Nov 8, 2021
maliming added a commit that referenced this issue Nov 9, 2021
@coskunkula
Copy link

I am using abp framework 5.2.1 version. I am running an application as a Blazor server. I need to use audit features. When I update any record, log and audit log are not kept. As a result of my long research, I ran the SaveChangesAsync method in DbContext.cs class by overrride and
var auditLog = AuditingManager?.Current?.Log; On line Current comes as null. I'm guessing it might be because of that. How can I do it?

@maliming
Copy link
Member

maliming commented May 9, 2022

For Blazor server: #11682 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants