130 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)
169ProjectResource => KnownResourceTypes.Project,
Dcp\DcpExecutor.cs (4)
411Executable => appModelResource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable, 824foreach (var project in modelProjectResources) 939var resourceType = resource is ProjectResource ? KnownResourceTypes.Project : KnownResourceTypes.Executable; 1060if (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)
133if (!resource.IsContainer() && resource is not ProjectResource)
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35where T : ProjectResource
AzureContainerAppsInfrastructure.cs (1)
52if (!r.IsContainer() && r is not ProjectResource)
ContainerAppContext.cs (3)
229(ProjectResource project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null, 237if (resource is ProjectResource && IsHttpScheme(endpoint.UriScheme)) 339var targetPort = httpIngress.Port ?? (resource is ProjectResource ? null : 80);
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 (9)
AzureContainerAppsTests.cs (7)
220var container = Assert.Single(model.GetProjectResources()); 779var proj = Assert.Single(model.GetProjectResources()); 1117var proj = Assert.Single(model.GetProjectResources()); 2303var project = Assert.Single(model.GetProjectResources()); 2442var project = Assert.Single(model.GetProjectResources()); 2646var project = Assert.Single(model.GetProjectResources()); 2859var project = Assert.Single(model.GetProjectResources());
ContainerRegistryTests.cs (1)
61var project = Assert.Single(model.GetProjectResources());
PublicApiTests\AppContainersPublicApiTests.cs (1)
94IResourceBuilder<ProjectResource> project = null!;
Aspire.Hosting.Docker (3)
DockerComposeInfrastructure.cs (1)
50if (!r.IsContainer() && r is not ProjectResource)
DockerComposeServiceResource.cs (2)
97if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource) 138if (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)
74var resource = Assert.Single(projectResources); 188var resource = Assert.Single(projectResources); 216var resource = Assert.Single(projectResources); 234var resource = Assert.Single(projectResources); 250var resource = Assert.Single(projectResources); 298var resource = Assert.Single(projectResources); 318var resource = Assert.Single(projectResources); 361var resource = Assert.Single(projectResources); 383var resource = Assert.Single(projectResources); 408var resource = Assert.Single(projectResources); 436var resource = Assert.Single(projectResources); 457var resource = Assert.Single(projectResources); 481var resource = Assert.Single(projectResources); 531var resource = Assert.Single(projectResources); 625var resource = Assert.Single(projectResources);
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
39var projects = appHost.Resources.OfType<ProjectResource>();
Infrastructure\DistributedApplicationExtensions.cs (2)
145(ProjectResource or ExecutableResource) 207public 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)
123public IResourceBuilder<ProjectResource> ServiceABuilder { get; private set; } 124public IResourceBuilder<ProjectResource> ServiceBBuilder { get; private set; } 125public IResourceBuilder<ProjectResource> ServiceCBuilder { get; private set; } 126public IResourceBuilder<ProjectResource> WorkerABuilder { get; private set; } 127public IResourceBuilder<ProjectResource>? IntegrationServiceABuilder { get; private set; } 130public List<IResourceBuilder<ProjectResource>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder]; 160foreach (var project in appModel.Resources.OfType<ProjectResource>())