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
Post a Comment