List Manipulation in C# using Linq

后端 未结 8 538
庸人自扰
庸人自扰 2020-12-24 12:24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace ConsoleApplication1
{

    public cla         


        
8条回答
  •  無奈伤痛
    2020-12-24 12:56

    If you wanted to do an update to multiple elements...

    foreach (var f in mylist.FindAll(x => x.id == 1))  
    {    
        f.id = car3.id;  
        f.color = car3.color;  
        f.make = car3.make;  
    }  
    

提交回复
热议问题