日期:2014-05-19  浏览次数:20728 次

有关于linq第二问
private   static   List <Student>   GetStudents()
                {
                        List <Student>   students   =   new   List <Student>   {  
                          new   Student{   Name= "YOUNG ",   Age=25,   Language= "Chinese "},
                          new   Student{   Name= "JESSIE ",   Age=21,   Language= "Scotland "},
                          new   Student{   Name= "KELLY ",   Age=18,   Language= "English "},
                          new   Student{   Name= "JUNE ",   Age=20,   Language= "English "},
                          new   Student{   Name= "ADRIAN ",   Age=22,   Language= "Italy "},
                          new   Student{   Name= "BRUCE ",   Age=17,   Language= "Scotland "}
                          };
                        return   students;

                }

  private   static   void   ComplexSelectLambda()
  {
                Console.WriteLine( " <hr> 多重选择的Lambda表达式: <br> ");

                List <Student>   studentList   =   GetStudents();
                string[]   stringArray   =   {   "Ajax ",   "Csharp ",   "Javascript ",   "Css   Desige ",   "Asp.net ",   "Gis "   };

                    //如何写才能输入以下的结果    
                        var   stu   =   from   sl   in   studentList                                          
                                            from   s   in   stringArray                                            
                                            select   new   {name=sl.Name,language=s};

              foreach   (var   s   in   stu)