Skip to content

Commit

Permalink
Use public method
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Apr 10, 2024
1 parent 0fb215c commit 8dbce9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PackageVersion Include="Microsoft.Azure.SignalR" Version="1.25.1" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.2" />
<!-- Azure Management SDK for .NET dependencies -->
<PackageVersion Include="Azure.Provisioning" Version="0.2.0-beta.1" />
<PackageVersion Include="Azure.Provisioning" Version="0.2.0-beta.2" />
<PackageVersion Include="Azure.Provisioning.AppConfiguration" Version="0.1.0-beta.1" />
<PackageVersion Include="Azure.Provisioning.ApplicationInsights" Version="0.1.0-beta.1" />
<PackageVersion Include="Azure.Provisioning.CognitiveServices" Version="0.1.0-beta.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Azure;
using Azure.Provisioning;
Expand Down Expand Up @@ -75,7 +74,7 @@ public static IResourceBuilder<AzureOpenAIResource> AddAzureOpenAI(this IDistrib

if (dependency != null)
{
AddDependency(cdkDeployment, dependency);
cdkDeployment.AddDependency(dependency);
}

dependency = cdkDeployment;
Expand All @@ -90,20 +89,6 @@ public static IResourceBuilder<AzureOpenAIResource> AddAzureOpenAI(this IDistrib
.WithParameter(AzureBicepResource.KnownParameters.PrincipalId)
.WithParameter(AzureBicepResource.KnownParameters.PrincipalType)
.WithManifestPublishingCallback(resource.WriteToManifest);

static void AddDependency(global::Azure.Provisioning.Resource resource, global::Azure.Provisioning.Resource dependency)
{
// abstract class Resource
// {
// internal void AddDependency(Resource resource)
// {
// Dependencies.Add(resource);
// }
// }

var addDependencyMethod = typeof(global::Azure.Provisioning.Resource).GetMethod("AddDependency", BindingFlags.NonPublic | BindingFlags.Instance);
addDependencyMethod?.Invoke(resource, [dependency]);
}
}

/// <summary>
Expand Down

0 comments on commit 8dbce9b

Please sign in to comment.