Can it be advantageous for a method to return IOrderedEnumerable instead of IEnumerable?
Can it be advantageous for a method to return IOrderedEnumerable<T> instead of IEnumerable<T>?
466 views Asked by Jim G. At
2
There are 2 answers
Related Questions in LINQ
- How to filter properties of derived classes in a DbContext with dynamic LINQ
- Query (or LINQ in Entity Framework) for getting user's rank
- How to return Inserted Updated Id in a Merge query
- Equivalent of LISTAGG in LINQ doesn't work
- Getting attribute from xml and printing it error
- Linq Grouping and workaround data entry errors in groups
- 'Unable to cast the type 'System.Guid' to type 'System.Object'. LINQ to Entities only supports casting EDM primitive or enumeration types.'
- linq issue accessing deep xml data
- OrderBy with lambda?
- Evaluating logical expressions recognized by ANTLR using the System.Linq.Expressions namespace
- Implementing List<T>, why wont it cast back to MyList after LINQ ? (Unable to cast object of type 'WhereListIterator`1)
- Linq GroupBy and Filter
- LINQ group by date and time
- How do I achieve client-side evaluation in LINQ?
- How do I create a Linq query that will return multiple complex properties in a sub property of a table?
Related Questions in OPTIMIZATION
- Optimize LCP ReactJs
- Efficiently processing many small elements of a collection concurrently in Java
- How to convert the size of the HTML document from 68 Kb to the average of 33 Kb?
- Optimizing Memory-Bound Loop with Indirect Prefetching
- Google or-tools soft constraint issue
- How to find function G(x), and make for every x, G(x) always returns fixed point for another function F(G(x))
- Trying to sort a set of words with the information theory to solve Worlde in Python but my program is way to slow
- Do conditional checks cause bottlenecks in Javascript?
- Hourly and annual optimization problem over matrix
- Sending asynchronous requests without a pre-defined task list
- DBT - Using SELECT * in the staging layer
- Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
- Is this a GCC optimiser bug or a feature?
- Performance difference between two JavaScript code snippets for comparing arrays of strings
- Distribute a list of positive numbers into a desired number of sets, aiming to have sums as close as possible between them
Related Questions in IENUMERABLE
- I dont understand what to do with: System.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.IEnumerable`1
- Cannot post IEnumerable data in .NET Core Web Application
- error Unable to cast object of type 'System.Collections.Generic.List` to type 'System.Collections.Generic.IList` via bindinglist in VB.NET
- Why is list of structs not IEnumerable<object>?
- null-conditional, null-coalescing, enumerable and params keyword
- C# "fork" foreach IEnumerable<T>
- Filter list datagridview via textbox using a second bindinglist class and set to bindingsource.datasource in vb.net
- How iterate over custom collection that implements IEnumerator<T>?
- IEnumerable to datatable
- How to make Generic code to dump to the debugger any IEnumerable and process KeyValuePair separately
- IEnumerable<T?> doesn't get converted to IEnumerable<T> in extension method
- IComparer implementation when ordering by two parameters
- What is the Execution Location for the below Snippet?
- How to add data to an IEnumerable - Table With related data - MudBlazor
- LINQ query expression vs using IEnumerable.Where and IEnumerable.Select
Related Questions in IORDEREDENUMERABLE
- OrderBy on mix of DateTime and DBNull values throws error
- Using LINQ on Observable Collection without losing Event subscriptions C#
- Strange behaviour of OrderBy Linq
- How to simply convert an IEnumerable into IOrderedEnumerable in O(1)?
- Why doesn't IOrderedEnumerable re-implement .Contains() to gain performance
- Why is this an invalid LINQ cast?
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Removing an object from IOrderedEnumerable
- Can I add a where clause to an IOrderedEnumerable list?
- How intelligent is Linq with IOrderedEnumerable and Where
- How can I return an IOrderedEnumerable from a Collection based on OrderBy "property"
- Add Collection to End of IOrderedEnumerable
- Will IOrderedEnumerable.Select() retain element order?
- Is it possible to turn an IEnumerable into an IOrderedEnumerable without using OrderBy?
- Sorting with OrderBy, ThenBy
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Only if you expect people to order that enumerable every time and would find it hard to figure out how to do this OR if you can provide a collection that implements that interface that can efficiently order its contents and is paired with an extension method that is aware of your collection.
Best option is to return a specific collection type (see Richter for details on that). 99 times out of 100 whoever gets even a simple enumerable can use the standard linq extension methods to order it if they want.