c# - How to map a child with a constructor that refer to the parent class in MongoDB -


i'm using mongodb (with csharp driver) on project , i'm trying figure out something. see class structure below :

public class {    public ienumerable<b> collection {get;}    public a()    {       collection = new list<b>();    } }  public class b {    private _parent;    public b(a parent)    {       _parent=parent;    }    public parent => _parent; } 

i'm trying configure mapping in mongo pass current deserialized instance of when deserialize child b. default, parent property of b isn't serialized. also, need create mapper class b because there's no default constructor can't figure out how tell mapper class pass instance of constructor paramter of b. clues ?


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -