• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

204
Vistas
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

about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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;
            });
about 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda