Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playground/DotnetTool/DotnetTool.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

// Some issues only show up when installing for first time, rather than using existing downloaded versions
// Use a specific NUGET_PACKAGES path for these playground tools, so we can easily reset them
builder.Eventing.Subscribe<BeforeStartEvent>(async (evt, _) =>
builder.OnBeforeStart(async (evt, _) =>
{
var nugetPackagesPath = Path.Join(evt.Services.GetRequiredService<IAspireStore>().BasePath, "nuget");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static IResourceBuilder<AzureContainerRegistryResource> AddAzureContainer
/// </summary>
private static void SubscribeToAddRegistryTargetAnnotations(IDistributedApplicationBuilder builder, AzureContainerRegistryResource registry)
{
builder.Eventing.Subscribe<BeforeStartEvent>((beforeStartEvent, cancellationToken) =>
builder.OnBeforeStart((beforeStartEvent, cancellationToken) =>
{
foreach (var resource in beforeStartEvent.Model.Resources)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public static IResourceBuilder<AzureCosmosDBResource> WithAccessKeyAuthenticatio
// need to do this later in case builder becomes an emulator after this method is called.
if (builder.ApplicationBuilder.ExecutionContext.IsRunMode)
{
builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((data, _) =>
builder.ApplicationBuilder.OnBeforeStart((data, _) =>
{
if (builder.Resource.IsEmulator)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private static IResourceBuilder<AzureFunctionsProjectResource> AddAzureFunctions
.Resource;
}

builder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
builder.OnBeforeStart((data, token) =>
{
var removeStorage = true;
// Look at all of the resources and if none of them use the default storage, then we can remove it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public static IResourceBuilder<AzurePostgresFlexibleServerResource> WithPassword
// need to do this later in case builder becomes an emulator after this method is called.
if (builder.ApplicationBuilder.ExecutionContext.IsRunMode)
{
builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
builder.ApplicationBuilder.OnBeforeStart((data, token) =>
{
if (builder.Resource.IsContainer())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static IResourceBuilder<AzureManagedRedisResource> WithAccessKeyAuthentic
// need to do this later in case builder becomes an emulator after this method is called.
if (builder.ApplicationBuilder.ExecutionContext.IsRunMode)
{
builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
builder.ApplicationBuilder.OnBeforeStart((data, token) =>
{
if (builder.Resource.IsContainer())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.Azure.Redis/AzureRedisExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static IResourceBuilder<AzureRedisCacheResource> WithAccessKeyAuthenticat
// need to do this later in case builder becomes an emulator after this method is called.
if (builder.ApplicationBuilder.ExecutionContext.IsRunMode)
{
builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
builder.ApplicationBuilder.OnBeforeStart((data, token) =>
{
if (builder.Resource.IsContainer())
{
Expand Down
8 changes: 4 additions & 4 deletions src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static IResourceBuilder<NodeAppResource> AddNodeApp(this IDistributedAppl

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
builder.OnBeforeStart((_, _) =>
{
// set the command to the package manager executable if the JavaScriptRunScriptAnnotation is present
if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) &&
Expand Down Expand Up @@ -463,7 +463,7 @@ private static IResourceBuilder<TResource> CreateDefaultJavaScriptAppBuilder<TRe
// ensure the package manager command is set before starting the resource
if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
builder.OnBeforeStart((_, _) =>
{
if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager))
{
Expand Down Expand Up @@ -631,7 +631,7 @@ public static IResourceBuilder<ViteAppResource> AddViteApp(this IDistributedAppl

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) =>
builder.OnBeforeStart((@event, _) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down Expand Up @@ -985,7 +985,7 @@ private static void AddInstaller<TResource>(IResourceBuilder<TResource> resource
.ExcludeFromManifest()
.WithCertificateTrustScope(CertificateTrustScope.None);

resource.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
resource.ApplicationBuilder.OnBeforeStart((_, _) =>
{
// set the installer's working directory to match the resource's working directory
// and set the install command and args based on the resource's annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static IResourceBuilder<KeycloakResource> AddKeycloak(

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
builder.OnBeforeStart((@event, cancellationToken) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static OtlpDevTunnelConfigurationAnnotation CreateOtlpDevTunnelInfrastru

// Manually allocate the stub endpoint so dev tunnel can start
// Dev tunnels wait for ResourceEndpointsAllocatedEvent before starting
appBuilder.Eventing.Subscribe<BeforeStartEvent>((evt, ct) =>
appBuilder.OnBeforeStart((evt, ct) =>
{
var endpoint = stubResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
if (endpoint is not null && endpoint.AllocatedEndpoint is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public static IResourceBuilder<UvicornAppResource> AddUvicornApp(

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
builder.OnBeforeStart((@event, cancellationToken) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down Expand Up @@ -510,7 +510,7 @@ private static IResourceBuilder<T> AddPythonAppCore<T>(
// and the dependencies will be established based on which resources actually exist
// Only do this in run mode since the installer and venv creator only run in run mode
var resourceToSetup = resourceBuilder.Resource;
builder.Eventing.Subscribe<BeforeStartEvent>((evt, ct) =>
builder.OnBeforeStart((evt, ct) =>
{
// Wire up wait dependencies for this resource based on which child resources exist
SetupDependencies(builder, resourceToSetup);
Expand Down Expand Up @@ -1346,7 +1346,7 @@ private static void AddInstaller<T>(IResourceBuilder<T> builder, bool install) w
installerBuilder.WithExplicitStart();
}

builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
builder.ApplicationBuilder.OnBeforeStart((_, _) =>
{
// Set the installer's working directory to match the resource's working directory
// and set the install command and args based on the resource's annotations
Expand Down
4 changes: 2 additions & 2 deletions src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static IResourceBuilder<RedisResource> AddRedis(

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
builder.OnBeforeStart((@event, cancellationToken) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down Expand Up @@ -387,7 +387,7 @@ public static IResourceBuilder<RedisResource> WithRedisInsight(this IResourceBui
})
.ExcludeFromManifest();

builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
builder.ApplicationBuilder.OnBeforeStart((@event, cancellationToken) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static IResourceBuilder<YarpResource> AddYarp(

if (builder.ExecutionContext.IsRunMode)
{
builder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
builder.OnBeforeStart((@event, cancellationToken) =>
{
var developerCertificateService = @event.Services.GetRequiredService<IDeveloperCertificateService>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static IResourceBuilder<ContainerRegistryResource> AddContainerRegistry(
/// </summary>
private static void SubscribeToAddRegistryTargetAnnotations(IDistributedApplicationBuilder builder, ContainerRegistryResource registry)
{
builder.Eventing.Subscribe<BeforeStartEvent>((beforeStartEvent, cancellationToken) =>
builder.OnBeforeStart((beforeStartEvent, cancellationToken) =>
{
foreach (var resource in beforeStartEvent.Model.Resources)
{
Expand Down
Loading
Loading