Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

403
Vistas
DBContext does not contain a definition for Entry: Cannot load related data

When trying to load related data and following the guide on Explicit Loading of Related Data, I get the following error:

IApplicationDbcontext does not contain a definition for Entry.

My example code, similar to theirs, includes:

var person = _context.Persons.Single(p => p.PersonId = id);
_context.Entry(person).Collection(p => p.Addresses).Load();

The difference in my case is that I am injecting an IApplicationDbContext which looks pretty standard and I assume doesn't make a difference:

public class ApplicationDbContext : DbContext, IApplicationDbContext
{
   ...
   public DbSet<Person> Persons { get; set; }
   public DbSet<Address> Addresses { get; set; }
   ...
}

I have Microsoft.EntityFrameworkCore 5.0.7 within this project.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your IApplicationDbContext must declare the following method signiture in it in order to work.

EntityEntry<TEntity> Entry<TEntity>([NotNullAttribute] TEntity entity) where TEntity : class;
over 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda