132 references to ProjectResource
Aspire.Hosting (55)
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)
172ProjectResource => KnownResourceTypes.Project,
Dcp\DcpExecutor.cs (4)
416Executable => appModelResource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable, 829foreach (var project in modelProjectResources) 944var resourceType = resource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable; 1065if (er.ModelResource is ProjectResource project)
Dcp\DcpNameGenerator.cs (1)
45else if (resource is ProjectResource)
Dcp\ResourceSnapshotBuilder.cs (1)
97projectPath = appModelResource is ProjectResource p ? p.GetProjectMetadata().ProjectPath : null;
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; 579/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{ProjectResource}, int)"/> is 596public static IResourceBuilder<ProjectResource> WithReplicas(this IResourceBuilder<ProjectResource> builder, int replicas) 617/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{ProjectResource})"/> 630public static IResourceBuilder<ProjectResource> DisableForwardedHeaders(this IResourceBuilder<ProjectResource> builder) 645public static IResourceBuilder<ProjectResource> WithEndpointsInEnvironment( 646this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter) 657/// Adds support for containerizing this <see cref="ProjectResource"/> during deployment. 671where T : ProjectResource 709private static IConfiguration GetConfiguration(ProjectResource projectResource) 730private static void SetAspNetCoreUrls(this IResourceBuilder<ProjectResource> builder) 777private static void SetBothPortsEnvVariables(this IResourceBuilder<ProjectResource> builder) 786private static void SetOnePortsEnvVariable(this IResourceBuilder<ProjectResource> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme) 821private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<ProjectResource> builder) 852private sealed class ProjectContainerResource(ProjectResource pr) : ContainerResource(pr.Name)
Publishing\ManifestPublishingContext.cs (4)
105else if (resource is ProjectResource project) 149private async Task WriteProjectAsync(ProjectResource project) 426(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 434if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme))
Publishing\ResourceContainerImageBuilder.cs (1)
40if (resource is ProjectResource)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 48internal static LaunchProfile? GetLaunchProfile(this ProjectResource projectResource, string launchProfileName, bool throwIfNotFound = false) 115private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 129private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 155private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 169internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 191internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
219return resource.IsContainer() || resource is ProjectResource || resource is AzureUserAssignedIdentityResource;
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35where T : ProjectResource
AzureContainerAppsInfrastructure.cs (1)
55if (!r.IsContainer() && r is not ProjectResource)
ContainerAppContext.cs (3)
241(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 249if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme)) 351var targetPort = httpIngress.Port ?? (resource is ProjectResource ? null : 80);
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceInfrastructure.cs (1)
40if (resource is not ProjectResource)
Aspire.Hosting.Azure.Functions (8)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
14internal static LaunchSettings? GetLaunchSettings(this ProjectResource projectResource) 31internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this ProjectResource projectResource, bool throwIfNotFound = false) 48internal static LaunchProfile? GetLaunchProfile(this ProjectResource projectResource, string launchProfileName, bool throwIfNotFound = false) 115private static bool TrySelectLaunchProfileByOrder(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 129private static bool TrySelectLaunchProfileFromDefaultAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 155private static bool TrySelectLaunchProfileFromAnnotation(ProjectResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 169internal static string? SelectLaunchProfileName(this ProjectResource projectResource) 191internal delegate bool LaunchProfileSelector(ProjectResource project, out string? launchProfile);
Aspire.Hosting.Azure.Tests (10)
AzureAppServiceTests.cs (1)
96var container = Assert.Single(model.GetProjectResources());
AzureContainerAppsTests.cs (7)
331var proj = Assert.Single(model.GetProjectResources()); 409var proj = Assert.Single(model.GetProjectResources()); 925var project = Assert.Single(model.GetProjectResources()); 963var project = Assert.Single(model.GetProjectResources()); 1008var project = Assert.Single(model.GetProjectResources()); 1050var project = Assert.Single(model.GetProjectResources()); 1337var project = Assert.Single(model.GetProjectResources());
ContainerRegistryTests.cs (1)
60var project = Assert.Single(model.GetProjectResources());
PublicApiTests\AppContainersPublicApiTests.cs (1)
93IResourceBuilder<ProjectResource> project = null!;
Aspire.Hosting.Docker (3)
DockerComposeInfrastructure.cs (1)
50if (!r.IsContainer() && r is not ProjectResource)
DockerComposeServiceResource.cs (2)
90if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource) 134if (waitAnnotation.Resource is ProjectResource || waitAnnotation.Resource.IsContainer())
Aspire.Hosting.Kubernetes (3)
KubernetesInfrastructure.cs (1)
50if (!r.IsContainer() && r is not ProjectResource)
KubernetesResource.cs (2)
131if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not ProjectResource) 167if (resource is ProjectResource && endpoint.TargetPort is null)
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
133/// <param name="builder">An <see cref="IResourceBuilder{T}"/> for <see cref="ProjectResource"/></param>
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
524var project = builder.CreateResourceBuilder<ProjectResource>("mywebapp1");
Aspire.Hosting.Tests (31)
Dashboard\DashboardResourceTests.cs (2)
525var dashboard = Assert.Single(model.Resources.OfType<ProjectResource>());
Dcp\DcpExecutorTests.cs (2)
55var resource = builder.AddProject<Projects.ServiceA>("ServiceA") 174var 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)
75var resource = Assert.Single(projectResources); 189var resource = Assert.Single(projectResources); 217var resource = Assert.Single(projectResources); 235var resource = Assert.Single(projectResources); 251var resource = Assert.Single(projectResources); 301var resource = Assert.Single(projectResources); 321var resource = Assert.Single(projectResources); 364var resource = Assert.Single(projectResources); 386var resource = Assert.Single(projectResources); 411var resource = Assert.Single(projectResources); 439var resource = Assert.Single(projectResources); 460var resource = Assert.Single(projectResources); 484var resource = Assert.Single(projectResources); 534var resource = Assert.Single(projectResources); 628var resource = Assert.Single(projectResources);
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
39var projects = appHost.Resources.OfType<ProjectResource>();
Infrastructure\DistributedApplicationExtensions.cs (2)
148(ProjectResource or ExecutableResource) 210public 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)
124public IResourceBuilder<ProjectResource> ServiceABuilder { get; private set; } 125public IResourceBuilder<ProjectResource> ServiceBBuilder { get; private set; } 126public IResourceBuilder<ProjectResource> ServiceCBuilder { get; private set; } 127public IResourceBuilder<ProjectResource> WorkerABuilder { get; private set; } 128public IResourceBuilder<ProjectResource>? IntegrationServiceABuilder { get; private set; } 131public List<IResourceBuilder<ProjectResource>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder]; 161foreach (var project in appModel.Resources.OfType<ProjectResource>())