My code looks like this:
var clientes = (from cliente in repositoryCliente.GetAll()
select new
{
cliente.Id,
cliente.Nome,
cliente.Email,
cliente.Telefone
}).ToList();
And my repository:
public virtual IEnumerable<T> GetAll()
{
return _dbSet;
}
But when parsing the sql command it does, it fetches all other fields (I'm using Entity Framework Profiler)
I want it to execute only the command sql "Select Id,Nome,Email,Telefone from Cliente"
, and not with the other columns.