나는 다음 명령을 같은 줄에 정렬하는 방법에 대한 표시를 주셔서 감사합니다.Linq 정렬 및 같은 줄에 Distinc 선택하는 방법
대단히 감사합니다!
OrderBy
reports
.Select(tt => tt.Producto)
.Distinct()
.OrderBy(p => p)
.ToList();
시퀀스의 각 항목에 대해 평가한다 식 기대 : 정렬
this.ProductosUnicos = this.repository.TemperatureReports.AsEnumerable().Select(tt => tt.Producto).Distinct().ToList();
public List<String> ProductosUnicos
{
get
{
return this._productosunicos;
}
private set
{
if (this._productosunicos == value)
return;
this._productosunicos = value;
this.OnPropertyChanged("ProductosUnicos");
}
}
-1 정렬 기준 _what_? 무엇을 정렬하려고했는지, 어떤 유형이 관련되어 있는지,'TemperatureReports'는 무엇인지,'Producto'는 무엇이 결과로 원하는가? –
안녕하세요, 선택된 고유 필드입니다. Producto. 감사. – Charles