Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
Mapping .Net Core Entities with One to Many relationship to Angular 2 interfaces

I'm creating a simple Blog using .Net Core C# and Angular 2.

Retrieving all the Posts worked fine, but I have now added an Array of Comments to each post and this has caused the following error:

enter image description here

Does TypeScript need more information about the comments?

Angular component:

enter image description here

API Method:enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I've managed to fix the problem.

Due to the circular reference inside of Entity Framework the JSON failed to parse.

I manged to fix it by adding this option inside the startup.cs:

 services.AddMvc()
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            });
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!