Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

self refrence still can not work #34

Open
SarcoZ opened this issue Dec 11, 2018 · 1 comment
Open

self refrence still can not work #34

SarcoZ opened this issue Dec 11, 2018 · 1 comment

Comments

@SarcoZ
Copy link

SarcoZ commented Dec 11, 2018

public class Area
{
[BsonId]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public ObjectId Id { get; private set; }
public string Name { get; set; }
public string Code { get; set; }
public virtual Area Parent { get; set; }
public virtual ICollection Areas { get; set; }
}

my class is area ,has child ICollection Areas,which is self refrence,
save can success,but can not read,use include still not work

@crhairr
Copy link
Member

crhairr commented Dec 16, 2018

I am currently working on this issue. It appears to be a problem with ForeignKey.IsSelfPrimaryReferencingKey() returning true, causing certain checks that try to map between ForeignKey.PrincipalToDependent and ForeignKey.DependentToPrincipal to incorrectly switch contexts. There seems to be a related piece of EF Core that I have yet to override that will fix it completely.

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

No branches or pull requests

2 participants