# ResourceUrlsCallbackContext

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

Represents a callback context for resource URLs.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class ResourceUrlsCallbackContext
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting/ResourceUrlsCallbackContext`

## Constructors

- [ResourceUrlsCallbackContext(DistributedApplicationExecutionContext, IResource, List<ResourceUrlAnnotation>, CancellationToken)](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/constructors.md#constructor-distributedapplicationexecutioncontext-iresource-list-resourceurlannotation-cancellationtoken) -- Represents a callback context for resource URLs.

## Properties

- [CancellationToken](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#cancellationtoken) : `CancellationToken` `get` -- Gets the [ResourceUrlsCallbackContext.CancellationToken](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#cancellationtoken) associated with the callback context.
- [ExecutionContext](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#executioncontext) : [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) `get` `ats export` -- Gets the execution context associated with this invocation of the AppHost.
- [Logger](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#logger) : `ILogger` `get; set` -- A logger instance to use for logging.
- [Resource](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#resource) : [IResource](/reference/api/csharp/aspire.hosting/iresource.md) `get` `ats export` -- Gets the resource this the URLs are associated with.
- [Urls](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#urls) : [List<ResourceUrlAnnotation>](/reference/api/csharp/aspire.hosting/resourceurlannotation.md) `get` -- Gets the URLs associated with the callback context.

## Methods

- [GetEndpoint(string)](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/methods.md#getendpoint-string) : [EndpointReference?](/reference/api/csharp/aspire.hosting/endpointreference.md) `ats export` -- Gets an endpoint reference from [ResourceUrlsCallbackContext.Resource](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#resource) for the specified endpoint name. If [ResourceUrlsCallbackContext.Resource](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#resource) does not implement [IResourceWithEndpoints](/reference/api/csharp/aspire.hosting/iresourcewithendpoints.md) then returns `null`.
- [GetEndpoint(string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/methods.md#getendpoint-string-networkidentifier) : [EndpointReference?](/reference/api/csharp/aspire.hosting/endpointreference.md) -- Gets an endpoint reference from [ResourceUrlsCallbackContext.Resource](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#resource) for the specified endpoint name. If [ResourceUrlsCallbackContext.Resource](/reference/api/csharp/aspire.hosting/resourceurlscallbackcontext/properties.md#resource) does not implement [IResourceWithEndpoints](/reference/api/csharp/aspire.hosting/iresourcewithendpoints.md) then returns `null`.
