本文介绍了Linq:如何从儿童班获取信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI
我有2个以下属性的课程
HI
I have 2 Classes with following properties
ClsEmployee
(
EmpID: Integer
Gender: integer( 0 means male, 1 means female)
Name: String
Children: listOf ClsChildren
}
ClsChildren
(
ChildName String
Gender integer( 0 means boy, 1 means girl)
Age integer
)
我有一份雇员名单使用
我需要获得最高,最低和平均年龄女性员工的女孩子。
谢谢
Ninad
添加的代码块[/ edit]
I have a list of Employees using which
I need to get the Max,Min, and average age of female children for female employee.
Thanks
Ninad
[edit]Code block added[/edit]
推荐答案
(From Employee As ClsEmployee In lstEmployee Where Employee.Gender = 1 Select _
(From Children As clsChildren In Employee.Children Where Children.Gender = 1 _
Select Children.Age).SingleOrDefault)
类似.Average和.Min命令将给出另外两个结果
similarly .Average and .Min commands will give the other two results
这篇关于Linq:如何从儿童班获取信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!