retrieving data from list in c# -


i trying retrieve data list of data. each element has following structure (not actual code):

   class pathpatternstringswithddv {        list<string> pathpatternstring;        list<point> ddv_xy;        string fromstate;    } 

i need compare first element of pathpatternstring , last element of ddv_xy , using following line of code:

 (list<pathpatternddxy_withprobability>) rtnlist =                allpathpatternddxy_withprob.where(a => a.pathpatternstring[0] == ptrn                                                      && a.fromstate == fstate                                                      && a.ddv_xy[a.ddv_xy.count - 1].x == _x                                                      && a.ddv_xy[a.ddv_xy.count - 1].y == _y 

this gets me error ("delegate not take 1 element"). ideas?

change line to:

 ienumerable<pathpatternddxy_withprobability> rtnlist =  allpathpatternddxy_withprob.where(a => a.pathpatternstring[0] == ptrn                                        && a.fromstate == fstate                                        && a.ddv_xy[a.ddv_xy.count - 1].x == _x                                        && a.ddv_xy[a.ddv_xy.count - 1].y == _y                                      ); 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -