7
I can’t do this?
public List<Filial> GetAll()
{
//Mostra todos os registros incluindo os desativados para os Administradores
var ret = _db.Filiais.AsNoTracking()
.Where(e => e.Visible)
.OrderBy(e => e.FilialNome)
.Select(x => new Filial
{
FilialId = x.FilialId,
FilialNome = x.FilialNome,
FilialEndereco = x.FilialEndereco,
FilialBairro = x.FilialBairro,
FilialFixPhone = x.FilialFixPhone
}).ToList();
return ret;
}
the mistake
The Entity or Complex type 'Ccvalemixef.Infra.Data.Context.Affiliate' cannot be constructed in a LINQ to Entities query.
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero