//public class Users {
             //   public int Id { set; get; }
             //   public string UName { set; get; }
             //   public int UAge { set; get; }
             // }
            var userList = new List<Users>{ 
                new Users{Id=1,UName="A",UAge=21},
                new Users{Id=2,UName="B",UAge=21},
                new Users{Id=3,UName="C",UAge=21},
                new Users{Id=4,UName="D",UAge=21}
            };


            List<System.Dynamic.ExpandoObject> objList = new List<System.Dynamic.ExpandoObject>();

            int a = 10;
            while (a < 20)
            {
                dynamic obj = new System.Dynamic.ExpandoObject();
                obj.ID = a;
                obj.FirstName = "Henry" + a;
                obj.LastName = "Cui" + a;
                obj.Age = "age" + a;
                obj.Time = "time" + a;
                a++;
                objList.Add(obj);
                //objList.Count();
            }
            var temp1 = (from u in objList select u).ToList();

            var temp = (from u in userList select u).ToList();
            return new { Reslut = "succss", Rows = temp, RowsNew = temp1 };

 

相关文章:

  • 2022-12-23
  • 2021-08-26
  • 2021-07-22
  • 2021-07-12
  • 2021-07-18
  • 2022-12-23
  • 2021-05-22
猜你喜欢
  • 2022-01-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-01-12
  • 2022-02-04
相关资源
相似解决方案