日期:2014-05-20 浏览次数:20915 次
List<AllNewsGroups> AllNewsGroups = new List<AllNewsGroups>();
List<AllNewsGroups2> AllNewsGroups2 = new List<ceshi.AllNewsGroups2>();
AllNewsGroups2.Add(new AllNewsGroups2 { Name = "新浪科技" });
AllNewsGroups2.Add(new AllNewsGroups2 { Name = "新浪科技" });
AllNewsGroups2.Add(new AllNewsGroups2 { Name = "新浪科技" });
AllNewsGroups2.Add(new AllNewsGroups2 { Name = "新浪科技" });
AllNewsGroups.Add(new AllNewsGroups { Name = "1",AllNewsGroups2 = AllNewsGroups2 });
AllNewsGroups.Select(m => (m.AllNewsGroups2.Where(t => t.Name == "新浪科技")).Count()>0);
public class AllNewsGroups
{
public string Name{get;set;}
public List<AllNewsGroups2> AllNewsGroups2 { get; set; }
}
public class AllNewsGroups2
{
public string Name { get; set; }
}