Using distinct with Entity Framework

2

I have an object with a structure something like this:

  • Date
  • Description

I'm thinking a distinct() in the description field because the records are ridiculously repeated.

The question is, does distinct() only consider the first or last record?

    
asked by anonymous 17.12.2015 / 17:35

2 answers

2

It considers all the columns that are in the select.

Select Data, Descricao from ....

data1 teste
data2 teste
data3 teste
data4 teste

In this case above the distinct would not change anything in the result.

    
17.12.2015 / 17:41
0

My question was not so clear, anyway Ricardo's response helped me in a general concept.

My resolution was quite an alternative, as follows:

    
17.12.2015 / 18:50