112 references to ProjectResource
Aspire.Hosting (53)
ApplicationModel\ProjectResourceExtensions.cs (4)
7/// Provides extension methods for <see cref="DistributedApplicationModel"/> to work with <see cref="ProjectResource"/> instances. 16public static IEnumerable<ProjectResource> GetProjectResources(this DistributedApplicationModel model) 20return model.Resources.OfType<ProjectResource>(); 29public static IProjectMetadata GetProjectMetadata(this ProjectResource projectResource)
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
28foreach (var project in beforeStartEvent.Model.GetProjectResources())
Dashboard\DashboardLifecycleHook.cs (1)
164ProjectResource => KnownResourceTypes.Project,
Dcp\DcpExecutor.cs (3)
385Executable => appModelResource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable, 763foreach (var project in modelProjectResources) 886var resourceType = resource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable;
Dcp\DcpNameGenerator.cs (1)
45else if (resource is ProjectResource)
Dcp\ResourceSnapshotBuilder.cs (2)
92projectPath = appModelResource is ProjectResource p ? p.GetProjectMetadata().ProjectPath : null; 173appModelResource is ProjectResource p &&
LaunchProfile.cs (1)
9/// Represents a launch profile for a <see cref="Aspire.Hosting.ApplicationModel.ProjectResource"/>.
LaunchSettings.cs (2)
9/// Represents the launch settings for a <see cref="ApplicationModel.ProjectResource"/>. 14/// Gets or sets the collection of named launch profiles associated with the <see cref="ApplicationModel.ProjectResource"/>.
ProjectResourceBuilderExtensions.cs (27)
61public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name) where TProject : IProjectMetadata, new() 94public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath) 141public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? launchProfileName) where TProject : IProjectMetadata, new() 179public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName) 228public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action<ProjectResourceOptions> configure) where TProject : IProjectMetadata, new() 237var project = new ProjectResource(name); 268public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, Action<ProjectResourceOptions> configure) 278var project = new ProjectResource(name); 287private static IResourceBuilder<ProjectResource> WithProjectDefaults(this IResourceBuilder<ProjectResource> builder, ProjectResourceOptions options) 309var projectResource = builder.Resource; 547/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{ProjectResource}, int)"/> is 564public static IResourceBuilder<ProjectResource> WithReplicas(this IResourceBuilder<ProjectResource> builder, int replicas) 585/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{ProjectResource})"/> 598public static IResourceBuilder<ProjectResource> DisableForwardedHeaders(this IResourceBuilder<ProjectResource> builder) 613public static IResourceBuilder<ProjectResource> WithEndpointsInEnvironment( 614this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter) 625/// Adds support for containerizing this <see cref="ProjectResource"/> during deployment. 639where T : ProjectResource 673private static IConfiguration GetConfiguration(ProjectResource projectResource) 694private static void SetAspNetCoreUrls(this IResourceBuilder<ProjectResource> builder) 741private static void SetBothPortsEnvVariables(this IResourceBuilder<ProjectResource> builder) 750private static void SetOnePortsEnvVariable(this IResourceBuilder<ProjectResource> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme) 785private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<ProjectResource> builder) 816private sealed class ProjectContainerResource(ProjectResource pr) : ContainerResource(pr.Name)
Publishing\ManifestPublishingContext.cs (4)
103else if (resource is ProjectResource project) 147private async Task WriteProjectAsync(ProjectResource project) 423(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 431if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (7)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 104private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 118private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 144private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 158internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 180internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35where T : ProjectResource
AzureContainerAppsInfrastructure.cs (4)
50if (!r.IsContainer() && r is not ProjectResource) 298(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 306if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme)) 408var targetPort = httpIngress.Port ?? (resource is ProjectResource ? null : 80);
Aspire.Hosting.Azure.Functions (7)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (7)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 104private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 118private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 144private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 158internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 180internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure.Tests (3)
AzureContainerAppsTests.cs (3)
235var container = Assert.Single(model.GetProjectResources()); 745var container = Assert.Single(model.GetProjectResources()); 1895var project = Assert.Single(model.GetProjectResources());
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
126/// <param name="builder">An <see cref="IResourceBuilder{T}"/> for <see cref="ProjectResource"/></param>
Aspire.Hosting.Tests (30)
Dashboard\DashboardResourceTests.cs (2)
513var dashboard = Assert.Single(model.Resources.OfType<ProjectResource>());
Dcp\DcpExecutorTests.cs (1)
54var resource = builder.AddProject<Projects.ServiceA>("ServiceA")
KestrelConfigTests.cs (12)
17var resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>( 53var resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>( 91var resource = CreateTestProjectResource<ProjectWithKestrelHttpsEndpoint>(operation: DistributedApplicationOperation.Run); 108var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(operation: DistributedApplicationOperation.Run); 134var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 175var resource = CreateTestProjectResource<ProjectWithOnlyKestrelHttpEndpoint>(); 213var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 280var resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>( 311var resource = CreateTestProjectResource<ProjectWithKestrelEndpointsLevelProtocols>( 348private static ProjectResource CreateTestProjectResource<TProject>( 350Action<IResourceBuilder<ProjectResource>>? callback = null, 459private static void AllocateTestEndpoints(ProjectResource resource)
ProjectResourceTests.cs (15)
72var resource = Assert.Single(projectResources); 186var resource = Assert.Single(projectResources); 214var resource = Assert.Single(projectResources); 232var resource = Assert.Single(projectResources); 248var resource = Assert.Single(projectResources); 296var resource = Assert.Single(projectResources); 316var resource = Assert.Single(projectResources); 359var resource = Assert.Single(projectResources); 381var resource = Assert.Single(projectResources); 406var resource = Assert.Single(projectResources); 434var resource = Assert.Single(projectResources); 455var resource = Assert.Single(projectResources); 479var resource = Assert.Single(projectResources); 529var resource = Assert.Single(projectResources); 620var resource = Assert.Single(projectResources);
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
41var projects = appHost.Resources.OfType<ProjectResource>();
Infrastructure\DistributedApplicationExtensions.cs (2)
147(ProjectResource or ExecutableResource) 211public static async Task<bool> TryApplyEfMigrationsAsync(this DistributedApplication app, ProjectResource project)
Infrastructure\ResourceExtensions.cs (2)
11/// Gets the name of the <see cref="ProjectResource"/> based on the project file path. 13public static string GetName(this ProjectResource project)
TestProject.AppHost (8)
TestProgram.cs (8)
109public IResourceBuilder<ProjectResource> ServiceABuilder { get; private set; } 110public IResourceBuilder<ProjectResource> ServiceBBuilder { get; private set; } 111public IResourceBuilder<ProjectResource> ServiceCBuilder { get; private set; } 112public IResourceBuilder<ProjectResource> WorkerABuilder { get; private set; } 113public IResourceBuilder<ProjectResource>? IntegrationServiceABuilder { get; private set; } 116public List<IResourceBuilder<ProjectResource>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder]; 146foreach (var project in appModel.Resources.OfType<ProjectResource>())