List with repeated records via Linq

Asked

Viewed 333 times

1

I am trying to perform a simple query with LINQ, and the code below is returning me repeated records in the first 5 lines of the list.

var teste = (from p in db.VW_PAGAMENTO_RECEBIDO where p.ID_Pessoa == 23 select p).ToList();

When I run the SQL script in SQL Manager, the records are displayed correctly (as shown below).

inserir a descrição da imagem aqui

Note that the file code is different in all records through Sqlmanager. However, when running via LINQ, the first 5 records display the repested data, equal to the first.

  • You could post your model VW_PAGAMENTO_RECEBIDO?

  • You are pointing the webconfig to the same bank?

  • Yes I’m pointing to the same webconfig @Dotnet

  • Try var test = (from p in db.VW_PAGAMENTO_RECEBIDO Where p.Id_person == 23 select new { p } ).Tolist();

  • 2

    The ideal would be for you to capture the query sql generated in Brazilian and see what was created.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.