在Linq中返回单个列表属性List [英] return a single list property List in Linq

查看:55
本文介绍了在Linq中返回单个列表属性List的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一个问题,我有一个清单

I am having an issue here i have a list

this.Ddown具有3个属性

this.Ddown having 3 properties

我想编写一个Linq查询以返回其中一个属性,假设我具有属性a,b,c

i want to write a Linq Query to return one of the property lets say i have property a,b,c

我想退出列表(c)

我如何在linq中做到这一点

how do i do that in linq

推荐答案

var cList = (from record in this.Ddown
             select record.c).ToList();

这篇关于在Linq中返回单个列表属性List的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆