Jedi Master Spooky
Jedi Master Spooky

Reputation: 5819

Entity Framework Load Error

I have this query

this.FixturePartidoPuntaje.Load();     

var partidos = from q in this.FixturePartidoPuntaje
               where ( q.FixturePartido.Equipo.EquipoId.Equals(equipoId) ||
                      q.FixturePartido.Equipo1.EquipoId.Equals(equipoId)) &&
                      q.puntaje > 0
               select q;

The most important here is that this is a Jugador Entity.

How do I load the FixturePartido and ius children?

Thanks

Upvotes: 0

Views: 1042

Answers (1)

Tomas Aschan
Tomas Aschan

Reputation: 60674

Use the .Include() command:

var partidos = from q in this.FixturePartidoPuntaje.Include("children")
               where (q.FixturePartido.Equipo.EquipoId.Equals(equipoId) ||
                      q.FixturePartido.Equipo1.EquipoId.Equals(equipoId)) &&
                      q.puntaje > 0
               select q;

"children" here is the name of the Navigational Property that you want to include, if my memory isn't way off...

Upvotes: 1

Related Questions