This is because you have a loop formed by classes referencing each other, it is obvious that the driver is not equipped to handle this, and I'm not sure what it should.
You need to decide how you want this data to be modeled in the database.
If you have two collections, one of the companies and one of the employees, then at the data level you should just include an id for the links.
If you have only one collection of companies, then you just need to change the employee class to refer to the company with an identifier instead of an object reference.
This is only needed in the database, but you can expand your model in your C # code to automatically add a link to an object or lazy loading, etc. (avoiding the choice of N + 1 questions, how do you do it) depending on what is appropriate for the situation.
Chris sainty
source share