c# - Calling method with linq syntax based on condition -
how loop through generic list , call method based on couple of conditions? i'd use linq syntax. following doesn't work of course. ideas?
somelist.foreach(i => i.depttype == 1 && != null () {mymethod(someint)}); if isn't possible, next best method using concise syntax?
try using specify records want select , foreach execute method:
somelist.where(i => i.depttype == 1 && != null) .tolist() .foreach( i=> mymethod(i.someint));
Comments
Post a Comment