score:1
Accepted answer
your select
is returning an ienumerable
of char
and you need to build a string from them by using string.join
like what you did in the stringbuilder
:
linkuret.text = string.join("" , playerlist.skip(skip).take(take).select(x => x.name));
score:0
i would rewrite your loop in this way
int skip = 0;
while (skip < playerlist.count)
{
hyperlink links= new hyperlink();
players p = playerlist.skip(skip).firstordefault();
links.text = $"{p.name}"
links.navigateurl = $"playerdetails.aspx?id={p.id}"
page.controls.add(links);
skip++;
}
first i have removed the take part from your code and used firstordefault to get always the first element after the skip. finally the players elements is loaded just one time and then i used the properties of the class with more readable code.
Source: stackoverflow.com
Related Query
- Skip and take method in List
- LINQ with Skip and Take
- Excluding one item from list (by Index), and take all others
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- LINQ query adding orderby makes Skip and Take not work Linqpad
- Casting result of Dictionary of objects after Skip and Take
- LINQ, Skip and Take ordering
- OrderByDescending with Skip and Take in LINQ shows error
- LINQ How to take one record and skip rest c#
- Getting COUNT and SKIP TAKE in one operation with Linq to Entities
- Using Skip and Take to pick up alternate items in an array
- Is it possible to ignore a list item using the Skip method of the LINQ then apply skip on the list without losing that item?
- LINQ to Entities Skip and Take
- Are Linq's Skip and Take optimized for arrays? [4.0 edition]
- Skip and Take option for java arraylist?
- IOrderedQueryable Skip and Take
- C# - Linq optimize code with List and Where clause
- LINQ: Paging technique, using take and skip but need total records also - how to implement this?
- How to filter a list with linq depends on counting a property at the same list and take a random group at least minimum total
- Most recent records with 2 tables and take / skip
- Is it possible to use Skip and Take whilst calculating an Average?
- How can I run a paged query in EF Core if Skip and Take are always evaluated locally?
- LINQ IQueryable returning same rows with skip and take
- In linq, how do I take specific parameter out of a list and build new list of different type?
- how does skip and take really work?
- How to remove selected data that found on another list and take last 6 id through LINQ without foreach loop
- LINQ to SQL - order by, group by and order by each group with skip and take
- LINQ: Skip and Take duplicates
- Search the list and take item based on the index value of the match
- Linq to Entities - Internal Behavior of Skip and Take
More Query from same tag
- See if Dictionary Item is the last one in the dictionary
- Linq to XML Queries
- Getting Paged Data Using LINQ
- Linq for objects
- Web Service taking object as parameters
- XDocument XElement.Descendants issue
- most matched field value
- First group a list acc to a custom rule and later sort the group based on another field
- Linq: group by + count for one column
- How can I user LINQ to get a IList<string> from a multi-table join?
- LINQ Dynamic List
- choose a few id from db C#
- Is there a .NET queue class that allows for dequeuing multiple items at once?
- Is there a way to Memorize or Materialize an IEnumerable?
- Dynamic LINQ - Is There A .NET 4 Version?
- Correct behavior of OrderBy
- How to filter a Tuple by a single item C#
- IQueryable<???> for linq-to-sql product type
- How to subtract the two columns sum of amount using linq
- c# lambda linq order by multiple column's index
- Inner query in Linq
- Setting where clause in LINQ query in loop always executes last where clause that was set
- Is XML Elements Attribute value always data type of string?
- Left outer join using LINQ -- understanding the code
- Can it be advantageous for a method to return IOrderedEnumerable<T> instead of IEnumerable<T>?
- LINQ Min/Max and minimizing iterations
- Return only certain columns to JSON in LINQ
- foreach iteration after Select
- Writing LINQ queries. Joins VS navigational properties
- "in" operator in linq c#?