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.

Self Referencing Column

See original GitHub issue

Is it possible for a column of an object to point back to that object? Example

public class Item(){
    public int id{get;set;}
    public string name {get;set;}
    [BsonRef]
    public Item parentitem{get;set;}
}

when “getcollection” is run for this class, a stack overflow error occurs when trying to declare the “parentitem” variable.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
unitedsoftworkcommented, May 14, 2018

@PascalSenn It actually throws the exception in the “GetCollection” method, before a value has ever been assigned to it.

0reactions
dptrcommented, Dec 23, 2020

this issue still exists, version:5.0.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

When would i use a self referential column in SQL Server?
SQL allows a column to have primary key constraint that is foreign key which is refering to another table's primary key. So it...
Read more >
Working with Self-Referencing Tables in Master-Detail Browser
Self -referencing table is a table that is a parent and a dependent in the same referential constraint, i.e. a foreign key constraint...
Read more >
Self-Referencing with Joins in SQL— Are There Better ...
As the name self-referencing suggests, it refers to multiple copies of the same table being joined together based on certain conditions. While joining...
Read more >
Self Referencing Foreign Key in MySQL [Explained]
Self Referencing Foreign Key is also known as Recursive Foreign Key. · It defines the relationship between the same entity or table. ·...
Read more >
Insert self referencing entry into SQL Server
I have a Person table that has a created_by column that references the primary id of the table itself. So, it could be...
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