c# - How should I change this source into LINQ? -


list<node> resultlist = new list<node>(); nodeequalitycomparer comparer = new nodeequalitycomparer();  foreach (vector3 move in movelist) {     foreach (node sight in sightlist)     {         if (comparer.equals((vector3)sight.position, move))             resultlist.add(sight);     } } 

how should change source linq?

var resultlist = movelist.selectmany(m => sightlist.where( s => comparer                                        .equals((vector3)s.position, m)).tolist(); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -