---
title: Build DSL
description: Use Build, With, Without, and OmitAutoProperties to control anonymous object creation.
---

When `Create` is too coarse, `Build<T>()` returns a composer you can configure before calling `Create()`.

## Example scenario

You are testing a component that reads `ClientDto.Name` and `ClientDto.Age`. You need to pin specific values for those properties while AutoFixture fills the rest — or leave some properties at their defaults.

## Example

**With** — set property values:

```csharp
var fixture = new Fixture();
var expectedName = fixture.Create<string>();

var client = fixture.Build<ClientDto>()
    .With(dto => dto.Name, expectedName)
    .With(dto => dto.Age, 42)
    .Create();

Assert.Equal(expectedName, client.Name);
Assert.Equal(42, client.Age);
```

**Without** — skip auto assignment:

```csharp
var client = fixture.Build<ClientDto>()
    .Without(dto => dto.Age)
    .Create();

Assert.Equal(default, client.Age);
```

**OmitAutoProperties** — empty shell:

```csharp
var client = fixture.Build<ClientDto>()
    .OmitAutoProperties()
    .Create();

Assert.Equal(string.Empty, client.Name);
Assert.Equal(default, client.Age);
```

## How it works

- `Build<T>()` — returns an `IPostprocessComposer<T>` you chain before `Create()`
- `With` — overrides a property value on the final specimen
- `Without` — leaves a property at its default instead of auto-assigning
- `OmitAutoProperties` — skips all property assignment; only constructor parameters are filled

Use `Build` when business rules or test assertions require specific property values. See [Refactoring a test](/docs/get-started/refactoring-a-test) for a graph constraint example.

## Next steps

- [Customizations](/docs/fundamentals/customizations)
- [Collections](/docs/how-to/collections)

## API

- [`Fixture.Build`](/api/autofixture/5-0-0-rc-1/autofixture.fixture#build)
