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.

Entity History for List of Navigation Properties inside Entity Not Working

See original GitHub issue

Hello, I am using entity history feature and I was trying to use it against entity that has list of navigation properties as following

[Audited]
public class Branch : FullAuditedAggregateRoot, IMustHaveTenant 
{
	public LocalizedText Name { get; private set; }
	public string Code { get; set; }
	public bool IsActive { get; private set; }

	public bool IsAirport { get; private set; }

	private readonly List<BranchUser> _branchUsers;
	public IReadOnlyCollection<BranchUser> BranchUsers => _branchUsers;

	public int TenantId { get; set; }
	public AddressInformation AddressInformation { get; private set; }
	public ContactInformation ContactInformation { get; private set; }

	private Branch() 
	{
		_branchUsers = new List<BranchUser>();
	}
}

It works only for owned types , but it didn’t work for list 😦

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
acjhcommented, Mar 4, 2019

I can’t yet. And it’s irrelevant. navigation is null in OnModelCreating. Please see my repro attempt and then create a repro that is forked from it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework Navigation Properties not loading
I'm using the code first option. Below I have a basic model. The database was created properly and the records persist properly but...
Read more >
Relationships, navigation properties, and foreign keys - EF6
In Entity Framework you commonly use navigation properties to load entities that are related to the returned entity by the defined association.
Read more >
How do you manage non-loaded navigation properties in ...
And I want this entity to come with some navigation properties already loaded. I have a lot of such methods.
Read more >
Navigation Property With Code First ...
In this article, you will learn about Navigation Property with code first and navigation property in Entity Framework.
Read more >
Entity Framework Core 5 - Pitfalls To Avoid and Ideas to Try
In this post, we'll look at some pitfalls and ideas EF Core users like yourself may want to consider when developing an application....
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