I have this:
List<Personal> lstPersonal = dbContext.Personal.Select(x => new
{
IDPersonal = x.IDPersonal,
Nombre = x.Nombre
}).AsEnumerable().Select(x => new Personal
{
IDPersonal = x.IDPersonal,
Nombre = x.Nombre
}).ToList();
I would like how can I know the T-SQL that is send to the database. I know that if I use an IQueriable I can use ToString for example to know the querty, but in this case I don't know hoe to do it.
The purpose of this query is to get onle a few fields of the database, it works, but I would like to know if all the fields are get from the database and later select only the desired fields or the database is send only the desired fields.
Thanks.