Unable to override reason while saving Entity History
See original GitHub issueI have used Entity History documentation on Abp Zero AspNetCore Template for Entity History feature. Used both UseCase Attribute & IEntityChangeSetReasonProvider to override the reason but it is still saving request display URL in database.
- Abp package version. : 3.8.2
- Base framework: .Net Core.
- Steps to reproduce the problem.
- Used Abp Zero AspNetCore Template and used following options to configure Abp
return services.AddAbp<WebHostModule>(
// Configure Serilog logging
options =>
{
options.IocManager.IocContainer.AddFacility<LoggingFacility>(
f => f.LogUsing(new SerilogFactory()));
options.IocManager.Register(typeof(ILogger<>), typeof(Logger<>));
}
);
- Create any Audited entity and modify it in ApplicationService using following options: UseCase Attribute
[UseCase(Description = "Assign an issue to a user")]
public virtual async Task AssignIssueAsync(AssignIssueInput input)
{
// ...
}
IEntityChangeSetReasonProvider
public class MyService
{
private readonly IEntityChangeSetReasonProvider _reasonProvider;
public MyService(IEntityChangeSetReasonProvider reasonProvider)
{
_reasonProvider = reasonProvider;
}
public virtual async Task AssignIssueAsync(AssignIssueInput input)
{
var reason = "Assign an issue to user: " + input.UserId.ToString();
using (_reasonProvider.Use(reason))
{
...
_unitOfWorkManager.Current.SaveChanges();
}
}
}
Am I missing any configuration?
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Entity Framework 4.1 DbContext Override SaveChanges to ...
I am trying to implement a constrained 'audit log' of property changes to a properties in a set of classes. I have successfully...
Read more >Not able to implement Entity History in ABP Framework, Why ...
I'm trying to implement an Audit/History table for my Entity so that I can see the deleted and old column values for a...
Read more >Hibernate Envers for Auditing
With Hibernate Envers, it is easy to document and audit all changes on the persisted Entities. History of an entity with all changes...
Read more >Overriding the save method - Django Models
We can override save function before storing the data in the database to apply some constraint or fill some ready only fields like...
Read more >Working with Transactions - EF6
UseTransaction() to clear Entity Framework's knowledge of the current transaction. Entity Framework will neither commit nor rollback the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi @sachinarora87 You can try changing this method to
virtual
. https://github.com/sachinarora87/TestCompany.TestProject/blob/master/src/TestCompany.TestProject.Application/InvoiceService.cs#L26@xmarwin thanks, it is the suggested usage, https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3853#issuecomment-421891787