# ContainerResourceExtensions Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerResourceExtensions](/reference/api/csharp/aspire.hosting/containerresourceextensions.md)
- Kind: `Methods`
- Members: `2`

Provides extension methods for working with container resources in a distributed application model.

## GetContainerResources(DistributedApplicationModel)

- Name: `GetContainerResources(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/ContainerResourceExtensions.cs#L21-L30)

Returns a collection of container resources in the specified distributed application model.

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

## Parameters

- `model` ([DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md))
  The distributed application model to search for container resources.

## Returns

[IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md) -- A collection of container resources in the specified distributed application model.

## ATS metadata

### Ignored by ATS

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

## IsContainer(IResource)

- Name: `IsContainer(IResource)`
- Modifiers: `extension`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ContainerResourceExtensions.cs#L40-L42)

Determines whether the specified resource is a container resource.

```csharp
public static class ContainerResourceExtensions
{
    public static bool IsContainer(
        this IResource resource)
    {
        // ...
    }
}
```

## Parameters

- `resource` ([IResource](/reference/api/csharp/aspire.hosting/iresource.md))
  The resource to check.

## Returns

`bool` -- true if the specified resource is a container resource; otherwise, false.

## ATS metadata

### Ignored by ATS

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