Skip to content

Commit 486a14d

Browse files
API review: Add Services property to ResourceEndpointsAllocatedEvent (#9270)
1 parent d116c4a commit 486a14d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Aspire.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ Global
39283928
{A3399DE9-AAB0-43EA-B99B-6A62ABBDD7BF}.Release|x64.Build.0 = Release|Any CPU
39293929
{A3399DE9-AAB0-43EA-B99B-6A62ABBDD7BF}.Release|x86.ActiveCfg = Release|Any CPU
39303930
{A3399DE9-AAB0-43EA-B99B-6A62ABBDD7BF}.Release|x86.Build.0 = Release|Any CPU
3931-
{6CBA29C8-FF78-4ABC-BEFA-2A53CB4DB2A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3931+
{6CBA29C8-FF78-4ABC-BEFA-2A53CB4DB2A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39323932
{6CBA29C8-FF78-4ABC-BEFA-2A53CB4DB2A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
39333933
{6CBA29C8-FF78-4ABC-BEFA-2A53CB4DB2A3}.Debug|x64.ActiveCfg = Debug|Any CPU
39343934
{6CBA29C8-FF78-4ABC-BEFA-2A53CB4DB2A3}.Debug|x64.Build.0 = Debug|Any CPU

src/Aspire.Hosting/ApplicationModel/ResourceEndpointsAllocatedEvent.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ namespace Aspire.Hosting.ApplicationModel;
1111
/// <remarks>
1212
/// Any resources that customize their URLs via a <see cref="ResourceUrlsCallbackAnnotation"/> will have their callbacks invoked during this event.
1313
/// </remarks>
14-
public class ResourceEndpointsAllocatedEvent(IResource resource) : IDistributedApplicationEvent
14+
public class ResourceEndpointsAllocatedEvent(IResource resource, IServiceProvider services) : IDistributedApplicationEvent
1515
{
1616
/// <inheritdoc />
1717
public IResource Resource { get; } = resource;
18+
19+
/// <summary>
20+
/// The <see cref="IServiceProvider"/> instance.
21+
/// </summary>
22+
public IServiceProvider Services { get; } = services;
1823
}

src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private async Task OnEndpointsAllocated(OnEndpointsAllocatedContext context)
105105
// Fire the endpoints allocated event for all resources.
106106
foreach (var resource in _model.Resources)
107107
{
108-
await _eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(resource), EventDispatchBehavior.NonBlockingConcurrent, context.CancellationToken).ConfigureAwait(false);
108+
await _eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(resource, _serviceProvider), EventDispatchBehavior.NonBlockingConcurrent, context.CancellationToken).ConfigureAwait(false);
109109
}
110110
}
111111

0 commit comments

Comments
 (0)