Check if list contains any of another list

前端 未结 3 2208

I have a list of parameters like this:

public class parameter
{
    public string name {get; set;}
    public string paramtype {get; set;}
    public string          


        
3条回答
  •  遥遥无期
    2020-12-02 09:30

    If both the list are too big and when we use lamda expression then it will take a long time to fetch . Better to use linq in this case to fetch parameters list:

    var items = (from x in parameters
                    join y in myStrings on x.Source equals y
                    select x)
                .ToList();
    

提交回复
热议问题