# EFMigrationResource.WithMigrationNamespace

- Module: [Aspire.Hosting.EntityFrameworkCore](/reference/api/go/aspire.hosting.entityframeworkcore.md)
- Defined on: [EFMigrationResource](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`

Configures the namespace for new migrations created with the Add Migration command.

## Remarks

If not specified, the namespace will be derived from the project's default namespace.
Example: `MyApp.Data.Migrations` or `MyApp.Infrastructure.Migrations`.

## Definition

```go
type EFMigrationResource interface {
    // ... omitted for brevity
    WithMigrationNamespace(namespace string) EFMigrationResource
}
```

## Signature

```go
WithMigrationNamespace(namespace string) EFMigrationResource
```

## Parameters

- `namespace` (`string`) -- The namespace for generated migrations.

## Returns

[`EFMigrationResource`](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md) -- The resource builder for chaining.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [EFMigrationResource](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md) -- `handle`
