---
title: "Two more LINQ extensions in dotnet 10"
description: "The preview 6 of dotnet 10 brings two more functions: `InfiniteSequence` and `Sequence`."
updated: 2025-08-18
canonical: "https://steven-giesel.com/blogPost/5d88d808-03ac-431a-82fa-756b59b38a7d/two-more-linq-extensions-in-dotnet-10"
---

# Two more LINQ extensions in dotnet 10

The preview 6 of dotnet 10 brings two more functions: `InfiniteSequence` and `Sequence`.

## `InfiniteSequence`

`InfiniteSequence` is a simple generator that allows you to get a sequence from a starting point via step size:

```csharp
var steps = Enumerable.InfiniteSequence(0, 5)
    .Take(10)
    .ToList();

foreach (var step in steps)
{
    Console.WriteLine(step);
}
```

This would print 0, 5, ... 45. So be careful not to call `ToList`/`Count` and friends without `Take` and so on, otherwise you will be greeted by an "Out of memory" exception.

## `Sequence`

That is almost the same as `InfiniteSequence` with the difference that you can define the **inclusive** upper bound:

```csharp
var steps = Enumerable.Sequence(0, 45, 5)
    .ToList();

foreach (var step in steps)
{
    Console.WriteLine(step);
}
```

The result would be the same as the `InfiniteSequence`.

**Update 22th of August:** As mentioned by [MizardX](https://github.com/MizardX) in the comments: Those methods are utilizing generic math and are defined like: `T: IAdditionOperators<T,T,T>` so they would work with your custom objects as long as they inherit from that interface!