//源数据

   List<object> li = new List<object>();
            foreach (var i in list)
            {
                li.Add(new { Id = i.Id, Name = i.Name });
            }

 //需要过渡的实体

 class TruckTeam
        {
          public string Id { get; set; }
           public string Name { get; set; }
        }

//接收的字典

Dictionary<string, string> a = new Dictionary<string, string>();

  //得到数据

  var s = li.Select(p=>p).ToList();

  //循环
            foreach (var i in s)
            {
                TruckTeam d = new TruckTeam();

    //拷贝转换  
                i.CopyTo<TruckTeam>(d);
                a.Add(d.Id,d.Name);
            }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-10-07
  • 2021-10-04
  • 2021-05-28
  • 2022-02-13
猜你喜欢
  • 2021-11-17
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-10-24
相关资源
相似解决方案