zoukankan      html  css  js  c++  java
  • Linq查询非泛型集合要指定Student类型(比如List)

       #region Linq to 集合查询非泛型集合要指定Student类型
                //ArrayList list = new ArrayList();
                //list.Add(new Student { Name = "Tom", Age = 17 });
                //list.Add(new Student { Name = "Jerry", Age = 16 });
                //list.Add(new Student { Name = "Marry", Age = 18 });
                //list.Add(new Student { Name = "Monika", Age = 22 });
                //list.Add(new Student { Name = "Frank", Age = 20 });
                //list.Add(new Student { Name = "Alex", Age = 15 });
                ////要指定Student类型
                //var result = from Student s in list
                //             where s.Name.Contains("M") && s.Age >= 18
                //             select s;

                //foreach (Student stu in result)
                //{
                //    Console.WriteLine("学员姓名:{0},年龄:{1}", stu.Name, stu.Age.ToString());
                //}
                #endregion

  • 相关阅读:
    文件光标移动
    python的版本的差别 "2","3"
    java通过jdbc操作Excel
    qt通过odbc操作Excel
    qt读取oracle表数据
    virtual box安装oracle_rac_10g
    oracle rac +standby
    rac不完全恢复
    rac完全恢复学习
    oracle rac搭建(三)--安装中的问题
  • 原文地址:https://www.cnblogs.com/914556495wxkj/p/4366696.html
Copyright © 2011-2022 走看看