# EFMigrationResource Constructors

- Package: [Aspire.Hosting.EntityFrameworkCore](/reference/api/csharp/aspire.hosting.entityframeworkcore.md)
- Type: [EFMigrationResource](/reference/api/csharp/aspire.hosting.entityframeworkcore/efmigrationresource.md)
- Kind: `Constructors`
- Members: `1`

Represents an EF Core migration resource associated with a project.

## EFMigrationResource(string, ProjectResource, string?)

- Name: `Constructor(string, ProjectResource, string?)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResource.cs#L24-L38)

Represents an EF Core migration resource associated with a project.

```csharp
public class EFMigrationResource
{
    public EFMigrationResource(
        string name,
        ProjectResource projectResource,
        string? dbContextTypeName)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `projectResource` (`ProjectResource`)
  The parent project resource that contains the DbContext.
- `dbContextTypeName` (`string?`)
  The fully qualified name of the DbContext type, or null to auto-detect.

## Remarks

The resource inherits from `ApplicationModel.ContainerResource` so it can be published as a container image that runs the migration bundle at deploy time when [EFMigrationResourceBuilderExtensions.PublishAsMigrationBundle(IResourceBuilder<EFMigrationResource>, string?, bool, bool, string?)](/reference/api/csharp/aspire.hosting.entityframeworkcore/efmigrationresourcebuilderextensions/methods.md#publishasmigrationbundle-iresourcebuilder-efmigrationresource-string-bool-bool-string) is called with `publishContainer: true`.
