0
I tried to make the following expression
var listag = db.grupo.Include(x => x.Itens).ToList();
It doesn’t work that way, but if I pass that way:
db.grupo.Include("Itens").ToList();
, So it works, why? What am I doing wrong?
0
I tried to make the following expression
var listag = db.grupo.Include(x => x.Itens).ToList();
It doesn’t work that way, but if I pass that way:
db.grupo.Include("Itens").ToList();
, So it works, why? What am I doing wrong?
2
The implementation of Include()
using a delegate type is in the namespace System.Data.Entity
for the Entity Framework case, or System.Linq
, if you were using Linq
, which is not your case.
As pointed out by @Tiagosilva in comment, check out the header of Controller
whether it has the following statements:
using System.Data;
using System.Data.Entity;
Browser other questions tagged entity-framework-6
You are not signed in. Login or sign up in order to post.
Don’t compile that way
– Rod
Which error, using the first way?
– Leonel Sanches da Silva
he doesn’t even recognize the expression in the visual studio
– Rod
Error 5 Cannot Convert lambda Expression to type 'string' because it is not a delegate type
– Rod
It worked well using System.Data.Entity, thank you =)
– Rod
@Tiagosilva Do you want to answer? Just so you don’t open the question.
– Leonel Sanches da Silva