Hey guys,
I want to display items in a dropdownlist like 5%, 10%, 15%, 20% until 100. Is there a way to bind an intelligent LINQ query to the datasource that will do this for me?
Hey guys,
I want to display items in a dropdownlist like 5%, 10%, 15%, 20% until 100. Is there a way to bind an intelligent LINQ query to the datasource that will do this for me?
You can use Enumerable.Range:
Enumerable.Range(1, 20).Select(x => 5 * x);
Or, in a more LINQ-like syntax:
from x in Enumerable.Range(1, 20)
select (x * 5);