question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Add an API to disable Entity History for specific controller\AppService method or to ommit EntityChanges without PropertyChanges

See original GitHub issue

Here is a simple use-case: let’s assume that we have following entity:

    [Audited]
    public class MyEntity : Entity
    {
        public string MyProperty1 { get; set; }

        [DisableAuditing]
        public int MyProperty2 { get; set; }

        public long MyProperty3 { get; set; }
    }

Every time ChangeTracker detects a change, we add a new EntityChangeSet (as well as corresponding EntityChange(s)), but an issue occurs when MyProperty2 (the one which is not audited) is the only property which is changing: EntityPropertyChanges of related EntityChange will contain no elements and is both counter intuitive (it makes no sense to have empty entry in entity history; viewing details of such entity changes in ‘Change Logs’ tab is confusing as the pop-up with details is actually empty).

Is there a (1) way to either temporary disable entity history for specific controller\method or (2) way to fix the issue when EntityChangeSet\EntityChange is being created when there are no PropertyChanges present?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ryancyqcommented, Dec 5, 2019

If you can upgrade to Abp 4.11 then you will be able to use the approach I suggested at https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5093#issuecomment-562060755 (a fix for entity history selectors was merged for Abp 4.11, https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4998)

Otherwise, Abp 5.0 is still pending on a fix at https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4953 to use the approach https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5093#issuecomment-562060755 (to be release with abp 5.1)

0reactions
4nonym0uscommented, Dec 5, 2019

Everything is working as expected after updating to 4.11 packages. Thanks for contributing into the development of entity history module and responding so fast.

IMHO, it’s worth mentioning the difference between using AuditedAttribute and Configuration.EntityHistory.Selectors in documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easy way for excluding entity from logs and history
I think it would be useful be able to easily exclude an entity from the logs and history with a clickable option.
Read more >
Add Remote API method to allow removal of historical ...
CONF-996 added the facility to the UI to remove historical versions of pages. Some customers require a remote API method to do the...
Read more >
c# - prevent property from being serialized in web API
It gives me a clean REST API. At the same time when I save the data in a no-sql, the ignored properties are...
Read more >
Retrieve a table row using the Web API - Power Apps
Use a GET request to retrieve data for a record specified as the resource with a unique identifier. When retrieving a table row...
Read more >
APIs
APIs are built using general best practices of REST API design. We take a schema-first approach by defining Types and Entities in JSON...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found