score:3
Accepted answer
if there is no data in the collection, take
returns no items. if there is actually some data around, you must have made some mistake in code you aren't showing us. remember: select ain't broken ...
by the way, there is also a reverse
, instead of skip(count - x).take(x)
.
Source: stackoverflow.com
Related Query
- .Take(5) returns a count of 0 on an ObservableCollection
- How to count the number of code lines in a C# solution, without comments and empty lines, and other redundant stuff, etc?
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- Using LINQ to delete an element from a ObservableCollection Source
- LINQ Source Code Available
- prevent unnecessary cross joins in count query of generated sql code
- .NET 4 Code Contracts: "requires unproven: source != null"
- LINQ query returns old results when source list is re-initialized
- creating Linq to sqlite dbml from DbLinq source code
- LINQ count query returns a 1 instead of a 0
- IQueryable returns null on invoking Count c#
- Return a value of 1 if linq query count returns zero
- Linq to entities query that returns a count and a list of objects
- EntityFramework LINQ query count fails but query returns result. How to optimize LINQ query?
- source code for LINQ 101 samples
- ASP.NET MVC - Linq Query with Count returns anonymous type. How to display in view?
- How to use Linq to group, sum or retrieve total. My current code returns nothing
- Linq LEFT JOIN, if the count is 0 it returns 1
- List or Array of String Contain specific word in Html Source Code
- Linq tolist() count returns different value from translated sql
- Linq count returns 0 but foeach returns something else
- c# Linq or code to extract groups from a single list of source data
- Use Count in Linq returns different results than SQL query
- Linq Find Partial Text Match - Included code returns duplicate and everything except what it should
- linq count returns 0 if the group by column is 0
- How to write SQL translateable linq code that groups by one property and returns distinct list
- aggregation count in linq query returns null
- Convert string[] to int[] in one line of code using LINQ
- LINQ with groupby and count
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
More Query from same tag
- Comparing values between 2 lists and subtracting values for common elements - C#
- translating a SQL query into a LINQ to SQL query
- Extract only values from insert statement string?
- LINQ: How can I Join to child table using data from group join?
- How to solve the cast to value type 'System.Decimal' failure error
- prefetching members of inherited entities via a LINQ-to-Entities query
- What is the best way in LINQ to sort 1000000 Records
- Linq query to create list of string arrays error
- How to use LINQ to query matching items to a list?
- updating a list using linq C#
- Linq late binding confusion
- Where predicate behavior when no element matches the condition
- Using Contains to do an IN statement within and LINQ clause using the Entity Framework
- Cannot compare in linq
- Linq: Group by ID order by Level then alphabetically troubles
- How to get row value where a corresponding value changed - LINQ
- 'int[]' does not contain a definition for 'Contains'
- Get rows with upline value
- Determine the relative complement of two IEnumerable<T> sets in .NET
- C# Sort by multiple value
- Filter a List using Dictionary keys
- Parallel invocation of elements of an IEnumerable
- How to perform multilevel aggregation in C#?
- LINQ QUERY TABLE
- Checking if a string is in an ObservableCollection of Tuple
- How can I say in Linq: "Where (e => e.tag == tags.AnyValue());"?
- Is there any way to use LINQ for MDX queries?
- c# linq exception: object reference not set to an instance of an object
- Linq - List of List
- Get all values between two specific values in a list