youniss2013 / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

TryWhere() TrySelectOrFallback() #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
TryWhere(predicate)

TryWhere should behave as regular Where, but also filter out the items where 
the predicate throws exception.

Many times a Where clause may be accessing a dictionary, or it may have have a 
long invocation chain within the item where null checks are impractical and 
only the "happy case" should have to be considered.

Of course it is undesirable to create a lot of exception, but the benefit in 
code clarity can often be worth it. This may also be the difference from using 
a lambda expression to using a named predicates declared elsewhere. Inlined 
predicates become less readable with a sprinkled "if null" , "if 
.ContainsKey()" and "if .Any()".

Original issue reported on code.google.com by tormod.s...@gmail.com on 16 Jun 2012 at 12:23

GoogleCodeExporter commented 8 years ago
This issue has been migrated to:
https://github.com/MoreLINQ/morelinq/issues/74
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is 
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of 
any further development.

Original comment by azizatif on 21 Aug 2015 at 6:55