---
title: Seed extensions
description: Influence generated values with seeded Create, CreateMany, and Freeze overloads from AutoFixture.SeedExtensions.
---

The **AutoFixture.SeedExtensions** package adds seed-aware `Create`, `CreateMany`, and `Freeze` overloads. Seeds are generic (`Create<T>(T seed)`), not string-only — string seeds are the most common case because AutoFixture turns them into readable prefixes by default.

## Prerequisites

- .NET 8+ test project
- [AutoFixture](/docs/get-started/installation) 5.0.0-rc.1

## Install

```xml
<PackageReference Include="AutoFixture.SeedExtensions" Version="5.0.0-rc.1" />
```

## Example scenario

You are testing code that displays generated labels. Random strings are hard to read in failure output — you want values that start with a known prefix but stay anonymous. Or you customize numeric creation with `FromSeed` and need to pass an explicit seed into `Create`.

## Create with a seed

```csharp
var fixture = new Fixture();

var result = fixture.Create("SeedPrefix");

Assert.StartsWith("SeedPrefix", result);
```

## CreateMany with a seed

Without a count, AutoFixture uses [`RepeatCount`](/api/autofixture/5-0-0-rc-1/autofixture.fixture#repeatcount):

```csharp
var results = fixture.CreateMany("Item").ToList();

Assert.Equal(fixture.RepeatCount, results.Count);
Assert.All(results, item => Assert.StartsWith("Item", item));
```

Pass an explicit count when you need a fixed length:

```csharp
var results = fixture.CreateMany("Item", 3).ToList();

Assert.Equal(3, results.Count);
Assert.All(results, item => Assert.StartsWith("Item", item));
```

## Freeze with a seed

`Freeze(seed)` creates a seeded value and freezes it so later requests for that type reuse the same instance:

```csharp
var frozen = fixture.Freeze("Frozen");

var again = fixture.Create("Something else");

Assert.Equal(frozen, again);
```

The seed shapes the first value. After that, Freeze pins that instance — a different seed on a later `Create` does not create a new string. To inject a known value without seeding, use [`Inject`](/docs/how-to/register-freeze-inject) instead.

## Seeds beyond strings

With [Customizations](/docs/fundamentals/customizations) `FromSeed`, an explicit seed drives non-string types too:

```csharp
fixture.Customize<int>(composer => composer.FromSeed(seed => seed * 10));

var value = fixture.Create(5);

Assert.Equal(50, value);
```

Bare `Create<int>()` still uses `default(int)` as the seed (`0`). Seeded overloads only matter when generators honor the seed — by default that is mainly strings; for other types you customize with `FromSeed`.

## How it works

- **`Create(seed)`** — one specimen, potentially influenced by the seed
- **`CreateMany(seed)`** — seeded sequence of length `RepeatCount`
- **`CreateMany(seed, count)`** — seeded sequence of fixed length
- **`Freeze(seed)`** — create from seed, then reuse that instance
- Seeds are `T` values; string seeds become readable prefixes by default

See also [Customizations](/docs/fundamentals/customizations) for `FromSeed` and [Register, Freeze, and Inject](/docs/how-to/register-freeze-inject) for unseeded Freeze/Inject.

## Next steps

- [Collections](/docs/how-to/collections)
- [Customizations](/docs/fundamentals/customizations)
- [Register, Freeze, and Inject](/docs/how-to/register-freeze-inject)
- [Idioms](/docs/extensions/idioms)

## API

- [AutoFixture.SeedExtensions package](/api/seedextensions/5-0-0-rc-1)
- [`CreateSeedExtensions`](/api/seedextensions/5-0-0-rc-1/autofixture.createseedextensions)
- [`FreezeSeedExtensions`](/api/seedextensions/5-0-0-rc-1/autofixture.freezeseedextensions)
