I am using the Entity Framework code first for data access and I have a Company class which has a collection of Employees. The Employee class also has a Company property.
If you're using WebAPI EntityFrameworkCore 2.0 this solution doesn't work, you need to set it on Startup.cs->ConfigureServices:
.AddJsonOptions(options => { var settings = options.SerializerSettings; settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; });