c# - Mixing two linq statement into one? -


i have 2 linq statements, both of them working. wondering if possible mix them 1 , proper list after 1 linq.

var result = list3.where(srodek => list4.any(x => x == srodek.srodek.category1) &&                                   (srodek.srodek.source.device == _text || srodek.srodek.id.device == _text))                   .tolist(); var list666 = list3.select(obj => new { obj, dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture) })                    .where(x => x.dt >= czas11 && x.dt <= czas22)                    .select(x => x.obj).tolist(); 

one list:

var result = list3.where(obj => {                               var dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture);                               return (list4.any(x => x == obj.srodek.category1) &&                               (obj.srodek.source.device == _text || obj.srodek.id.device == _text)) ||                               (dt >= czas11 && dt <= czas22);})                          .tolist(); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -