# DistributedApplicationModel Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md)
- Kind: `Constructors`
- Members: `2`

Represents a distributed application.

## DistributedApplicationModel(IResourceCollection)

- Name: `Constructor(IResourceCollection)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DistributedApplicationModel.cs)

Represents a distributed application.

```csharp
public class DistributedApplicationModel
{
    public DistributedApplicationModel(
        IResourceCollection resources)
    {
        // ...
    }
}
```

## Parameters

- `resources` ([IResourceCollection](/reference/api/csharp/aspire.hosting/iresourcecollection.md))
  The resource collection used to initiate the model.

## DistributedApplicationModel(IEnumerable<IResource>)

- Name: `Constructor(IEnumerable<IResource>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DistributedApplicationModel.cs)

Initializes a new instance of the [DistributedApplicationModel](/reference/api/csharp/aspire.hosting/distributedapplicationmodel.md) class with the specified resource collection.

```csharp
public class DistributedApplicationModel
{
    public DistributedApplicationModel(
        IEnumerable<IResource> resources)
    {
        // ...
    }
}
```

## Parameters

- `resources` ([IEnumerable<IResource>](/reference/api/csharp/aspire.hosting/iresource.md))
  The resources used to initiate the model.
