我是LINQ的新手。我有一类这样的:LINQ-基于特定值排列对象列表
public class StudentResults
{
public int Id { get; set; }
public ResultsStatus StatusResult { get; set; }
public string Message { get; set; }
public StudentDetails Detail { get; set; }
}
有返回上面的类的List变量
我需要循环直通变量,并把学生分成两个不同的类的方法。 通过学生,基于ResultsStatus的失败学生。
这里是我试过,但它不工作
var studIds = from r in StudList
group r by r.Id into GroupedData
select new
{
//what to put here
};
foreach(var crs in studIds)
{
//what to put here to get all student names from the Detail property.
}
有另一种方式?
你是如何计划使用两个“班”的学生? – 2010-10-11 15:25:17