Comments (4)
Compelling feature!
Original comment by [email protected]
on 23 Nov 2012 at 8:37
from morelinq.
I need this right now !
Original comment by [email protected]
on 5 Dec 2012 at 1:04
from morelinq.
You can implement this easily with a combination of using nullables and
Prepend/Concat a null before calling Min/Max, like this:
var some = Enumerable.Range(10, 10);
var none = Enumerable.Range(10, 0);
Console.WriteLine(some.Cast<int?>().Prepend(null).Min()); // prints 10
Console.WriteLine(none.Cast<int?>().Prepend(null).Min()); // prints null
Console.WriteLine(some.Cast<int?>().Prepend(null).Max()); // prints18
Console.WriteLine(none.Cast<int?>().Prepend(null).Max()); // prints null
Once you have a null you can use ?? fault in a value. The implementation in the
blog article[1] suffers from iterating the sequence twice.
[1]
http://blogs.telerik.com/xamlteam/posts/08-10-17/linq-sequence-contains-no-eleme
nts-extension-methods-to-the-rescue.aspx
Original comment by azizatif
on 22 Jun 2013 at 12:15
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from morelinq.
This issue has been migrated to:
https://github.com/MoreLINQ/morelinq/issues/28
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
from morelinq.
Related Issues (20)
- add Memoize support HOT 2
- ForEach should optionally take an index HOT 2
- ToDataTable throws on type with public static member HOT 6
- It would be nice to have a Top operator that would merge OrderBy and Take HOT 1
- F# countBy analogue HOT 2
- Usage example for SingleOrFallback HOT 7
- converting IEnumerable<TSource> into IEnumerable<IEnumerable<TSource>>? HOT 2
- Buffering HOT 2
- Please make .NET 4 compatible distribution (or allow silent modifications) HOT 1
- Interleave irregular enumerables with circular strategy HOT 5
- TakeLast example incorrect HOT 5
- Patch for /MoreLinq/DistinctBy.cs HOT 2
- Implement Full Outer Join HOT 1
- ExpandoObject inclusion HOT 4
- Patch for /MoreLinq/EquiZip.cs HOT 1
- Change ArgumentNullException to early return. HOT 1
- MaxByOrDefault HOT 3
- Scan should not throw on empty sequences HOT 1
- Batch should return an IEnumerable<IList<T>> HOT 2
- Migrate to GitHub/BitBucket HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from morelinq.