# ContainerPortReference Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerPortReference](/reference/api/csharp/aspire.hosting/containerportreference.md)
- Kind: `Constructors`
- Members: `1`

Represents a TCP/UDP port that a container can expose.

## ContainerPortReference(IResource)

- Name: `Constructor(IResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerPortReference.cs#L12-L17)

Represents a TCP/UDP port that a container can expose.

```csharp
public class ContainerPortReference
{
    public ContainerPortReference(
        IResource resource)
    {
        // ...
    }
}
```

## Parameters

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