# DistributedApplicationModelExtensions Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DistributedApplicationModelExtensions](/reference/api/csharp/aspire.hosting/distributedapplicationmodelextensions.md)
- Kind: `Methods`
- Members: `3`

Provides extension methods on the [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md) class.

## GetBuildAndPushResources(DistributedApplicationModel)

- Name: `GetBuildAndPushResources(DistributedApplicationModel)`
- Modifiers: `extension`
- Returns: [IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DistributedApplicationModelExtensions.cs#L68-L75)

Returns the build and push resources from the [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md). Build and push resources are those that require building and pushing container images to a registry, and are not marked to be ignored by the manifest publishing callback annotation.

```csharp
public static class DistributedApplicationModelExtensions
{
    public static IEnumerable<IResource> GetBuildAndPushResources(
        this DistributedApplicationModel model)
    {
        // ...
    }
}
```

## Parameters

- `model` ([DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md))
  The distributed application model to extract build and push resources from.

## Returns

[IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md) -- An enumerable of build and push [IResource](/reference/api/csharp/aspire.hosting/iresource.md) in the model.

## ATS metadata

### Ignored by ATS

- Reason: Application model inspection helper -- not part of the ATS surface.

## GetBuildResources(DistributedApplicationModel)

- Name: `GetBuildResources(DistributedApplicationModel)`
- Modifiers: `extension`
- Returns: [IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DistributedApplicationModelExtensions.cs#L50-L57)

Returns the build resources from the [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md). Build resources are those that are either build-only containers or project resources, and are not marked to be ignored by the manifest publishing callback annotation.

```csharp
public static class DistributedApplicationModelExtensions
{
    public static IEnumerable<IResource> GetBuildResources(
        this DistributedApplicationModel model)
    {
        // ...
    }
}
```

## Parameters

- `model` ([DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md))
  The distributed application model to extract build resources from.

## Returns

[IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md) -- An enumerable of build [IResource](/reference/api/csharp/aspire.hosting/iresource.md) in the model.

## ATS metadata

### Ignored by ATS

- Reason: Application model inspection helper -- not part of the ATS surface.

## GetComputeResources(DistributedApplicationModel)

- Name: `GetComputeResources(DistributedApplicationModel)`
- Modifiers: `extension`
- Returns: [IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DistributedApplicationModelExtensions.cs#L20-L39)

Returns the compute resources from the [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md). Compute resources are those that are either containers or project resources, and are not marked to be ignored by the manifest publishing callback annotation.

```csharp
public static class DistributedApplicationModelExtensions
{
    public static IEnumerable<IResource> GetComputeResources(
        this DistributedApplicationModel model)
    {
        // ...
    }
}
```

## Parameters

- `model` ([DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md))
  The distributed application model to extract compute resources from.

## Returns

[IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md) -- An enumerable of compute [IResource](/reference/api/csharp/aspire.hosting/iresource.md) in the model.

## ATS metadata

### Ignored by ATS

- Reason: Application model inspection helper -- not part of the ATS surface.
