# EndpointReferenceAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/EndpointReferenceAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

An annotation that represents a reference from one resource to the endpoints of another resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class EndpointReferenceAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Constructors

- [EndpointReferenceAnnotation(IResourceWithEndpoints)](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/constructors.md#constructor-iresourcewithendpoints) -- An annotation that represents a reference from one resource to the endpoints of another resource.

## Properties

- [ContextNetworkID](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/properties.md#contextnetworkid) : [NetworkIdentifier](/reference/api/csharp/aspire.hosting/networkidentifier.md) `get; set` -- Gets or sets the network identifier used as context for resolving endpoint addresses.
- [EndpointNames](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/properties.md#endpointnames) : `HashSet<string>` `get` -- Gets the set of specific endpoint names that are referenced. When [EndpointReferenceAnnotation.UseAllEndpoints](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/properties.md#useallendpoints) is `true`, this set is ignored.
- [Resource](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/properties.md#resource) : [IResourceWithEndpoints](/reference/api/csharp/aspire.hosting/iresourcewithendpoints.md) `get` -- Gets the resource whose endpoints are being referenced.
- [UseAllEndpoints](/reference/api/csharp/aspire.hosting/endpointreferenceannotation/properties.md#useallendpoints) : `bool` `get; set` -- Gets or sets a value indicating whether all endpoints on the referenced resource are included.
