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.

Support for logging changes to collections in EF Core?

See original GitHub issue

Does the EF Core logging support logging changes to collections such as List<NavigationProperty>, such as Features below?

e.g.

public class Bicycle
{
    public int Id { get; set; }
    public List<Feature> Features { get; set; }
}

public class Feature
{
    public int Id { get; set; }
    public string Name { get; set; }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mrlifecommented, Mar 12, 2021

@thepirat000 Thank you so much.

1reaction
thepirat000commented, Mar 12, 2021

For the first question refer to this. In this case IAudit is just an example of a common interface implemented by your audited entities.

For the second, please note the model will not be created automatically by the audit library, is up to you how do you want to structure the audit tables, i.e. One table for all the audits, one audit table per audited entity, and so on. Here are multiple use cases with examples of the EF provider configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Detection and Notifications - EF Core
Detecting property and relationship changes using DetectChanges or notifications.
Read more >
Change Tracking - EF Core
EF Core change tracking works best when the same DbContext instance is used to both query for entities and update them by calling...
Read more >
Track changes to collections using Entity Framework ...
I can get the changed entities by calling this.ChangeTracker.Entries() in my DbContext derivative and looking at the values for anything marked ...
Read more >
How To Track Entity Changes With EF Core | Audit Logging
Check out my Pragmatic Clean Architecture course: https://www.milanjovanovic.tech/pragmatic-clean-architecture Support me on Patreon to ...
Read more >
AuditTrail - How to log and track object changes with EF ...
AuditTrail - How to log and track object changes with EF Core in a non-XAF .NET app · Answers approved by DevExpress Support...
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