Using LINQ to convert List to List

前端 未结 5 962
长发绾君心
长发绾君心 2020-12-14 05:49

I have 2 classes which have some identical properties. I stock into a list properties from 1st class, and after that, I want to take some needed properties and put them into

5条回答
  •  春和景丽
    2020-12-14 06:30

    var iweilCopy = sil.Select(item => new InvoiceWithEntryInfo()
    {
      IdWEI = item.Id,
      NameWEI = item.Name,
      ....
    }).ToList();
    

提交回复
热议问题