Pessoal, preciso fazer o seguinte:
Tenho uma tabela historico, segue img:

Fiz uma consulta LINQ, para pegar o último registro inserido, as seguintes colunas = nomes_cargos.nome e salario, mas dá exceção na Query.
var query = (from b in ef.historico
where b.id_colaborador == Convert.ToInt32(tbID.Text)
select new { b.nomes_cargos.nome, b.salario }).LastOrDefault();
Segue Exception:
LINQ to Entities does not recognize the method '<>f__AnonymousType9`2[System.String,System.Decimal] LastOrDefault[<>f__AnonymousType9`2](System.Linq.IQueryable`1[<>f__AnonymousType9`2[System.String,System.Decimal]])' method, and this method
cannot be translated into a store expression.