Return list property list in Linq

I have a problem, I have a list

this.Ddown having 3 properties

I want to write Linq Query to return one of the properties, let's say I have property a, b, c

I need a retutn (c) list

how to do it in linq

+4
source share
3 answers
var cList = (from record in this.Ddown select record.c).ToList(); 
+8
source
 var listOfC = this.Ddown.Select(x => xc).ToList(); 
+6
source

I think I got this syntax right,

 var listOfC = (from x in this.Ddown select xc).ToList() 
0
source

Source: https://habr.com/ru/post/1309795/


All Articles