108 references to ProjectResource
Aspire.Hosting (49)
ApplicationModel\ProjectResourceExtensions.cs (4)
7
/// Provides extension methods for <see cref="DistributedApplicationModel"/> to work with <see cref="
ProjectResource
"/> instances.
16
public static IEnumerable<
ProjectResource
> GetProjectResources(this DistributedApplicationModel model)
20
return model.Resources.OfType<
ProjectResource
>();
29
public static IProjectMetadata GetProjectMetadata(this
ProjectResource
projectResource)
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
28
foreach (
var
project in beforeStartEvent.Model.GetProjectResources())
Dashboard\DashboardLifecycleHook.cs (1)
149
ProjectResource
=> KnownResourceTypes.Project,
Dcp\ApplicationExecutor.cs (4)
679
projectPath = appModelResource is
ProjectResource
p ? p.GetProjectMetadata().ProjectPath : null;
760
appModelResource is
ProjectResource
p &&
1098
foreach (
var
project in modelProjectResources)
1226
ResourceType = resource is
ProjectResource
? KnownResourceTypes.Project : KnownResourceTypes.Executable,
Dcp\DcpNameGenerator.cs (1)
45
else if (resource is
ProjectResource
)
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 (24)
61
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name) where TProject : IProjectMetadata, new()
94
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath)
141
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? launchProfileName) where TProject : IProjectMetadata, new()
179
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName)
228
public static IResourceBuilder<
ProjectResource
> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action<ProjectResourceOptions> configure) where TProject : IProjectMetadata, new()
237
var
project = new ProjectResource(name);
268
public static IResourceBuilder<
ProjectResource
> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, Action<ProjectResourceOptions> configure)
278
var
project = new ProjectResource(name);
287
private static IResourceBuilder<
ProjectResource
> WithProjectDefaults(this IResourceBuilder<
ProjectResource
> builder, ProjectResourceOptions options)
309
var
projectResource = builder.Resource;
546
/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{
ProjectResource
}, int)"/> is
563
public static IResourceBuilder<
ProjectResource
> WithReplicas(this IResourceBuilder<
ProjectResource
> builder, int replicas)
584
/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{
ProjectResource
})"/>
597
public static IResourceBuilder<
ProjectResource
> DisableForwardedHeaders(this IResourceBuilder<
ProjectResource
> builder)
612
public static IResourceBuilder<
ProjectResource
> WithEndpointsInEnvironment(
613
this IResourceBuilder<
ProjectResource
> builder, Func<EndpointAnnotation, bool> filter)
623
private static IConfiguration GetConfiguration(
ProjectResource
projectResource)
644
private static void SetAspNetCoreUrls(this IResourceBuilder<
ProjectResource
> builder)
691
private static void SetBothPortsEnvVariables(this IResourceBuilder<
ProjectResource
> builder)
700
private static void SetOnePortsEnvVariable(this IResourceBuilder<
ProjectResource
> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme)
735
private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<
ProjectResource
> builder)
Publishing\ManifestPublishingContext.cs (4)
103
else if (resource is
ProjectResource
project)
147
private async Task WriteProjectAsync(
ProjectResource
project)
423
(
ProjectResource
project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null,
431
if (resource is
ProjectResource
&& IsHttpScheme(endpoint.UriScheme))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (7)
14
internal static LaunchSettings? GetLaunchSettings(this
ProjectResource
projectResource)
31
internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this
ProjectResource
projectResource, bool throwIfNotFound = false)
104
private static bool TrySelectLaunchProfileByOrder(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
118
private static bool TrySelectLaunchProfileFromDefaultAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
144
private static bool TrySelectLaunchProfileFromAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
158
internal static string? SelectLaunchProfileName(this
ProjectResource
projectResource)
180
internal delegate bool LaunchProfileSelector(
ProjectResource
project, out string? launchProfile);
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppProjectExtensions.cs (1)
35
where T :
ProjectResource
AzureContainerAppsInfrastructure.cs (4)
50
if (!r.IsContainer() && r is not
ProjectResource
)
298
(
ProjectResource
project, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) => null,
306
if (resource is
ProjectResource
&& IsHttpScheme(endpoint.UriScheme))
408
var targetPort = httpIngress.Port ?? (resource is
ProjectResource
? null : 80);
Aspire.Hosting.Azure.Functions (7)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (7)
14
internal static LaunchSettings? GetLaunchSettings(this
ProjectResource
projectResource)
31
internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this
ProjectResource
projectResource, bool throwIfNotFound = false)
104
private static bool TrySelectLaunchProfileByOrder(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
118
private static bool TrySelectLaunchProfileFromDefaultAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
144
private static bool TrySelectLaunchProfileFromAnnotation(
ProjectResource
projectResource, [NotNullWhen(true)] out string? launchProfileName)
158
internal static string? SelectLaunchProfileName(this
ProjectResource
projectResource)
180
internal delegate bool LaunchProfileSelector(
ProjectResource
project, out string? launchProfile);
Aspire.Hosting.Azure.Tests (3)
AzureContainerAppsTests.cs (3)
235
var
container = Assert.Single(model.GetProjectResources());
520
var
container = Assert.Single(model.GetProjectResources());
1684
var
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)
513
var
dashboard = Assert.Single(model.Resources.OfType<
ProjectResource
>());
Dcp\ApplicationExecutorTests.cs (1)
56
var
resource = builder.AddProject<Projects.ServiceA>("ServiceA")
KestrelConfigTests.cs (12)
17
var
resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>(
53
var
resource = CreateTestProjectResource<ProjectWithProfileEndpointAndKestrelHttpEndpoint>(
91
var
resource = CreateTestProjectResource<ProjectWithKestrelHttpsEndpoint>(operation: DistributedApplicationOperation.Run);
108
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(operation: DistributedApplicationOperation.Run);
134
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
175
var
resource = CreateTestProjectResource<ProjectWithOnlyKestrelHttpEndpoint>();
213
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
280
var
resource = CreateTestProjectResource<ProjectWithMultipleHttpKestrelEndpoints>(
311
var
resource = CreateTestProjectResource<ProjectWithKestrelEndpointsLevelProtocols>(
348
private static
ProjectResource
CreateTestProjectResource<TProject>(
350
Action<IResourceBuilder<
ProjectResource
>>? callback = null,
459
private static void AllocateTestEndpoints(
ProjectResource
resource)
ProjectResourceTests.cs (15)
72
var
resource = Assert.Single(projectResources);
186
var
resource = Assert.Single(projectResources);
214
var
resource = Assert.Single(projectResources);
232
var
resource = Assert.Single(projectResources);
248
var
resource = Assert.Single(projectResources);
296
var
resource = Assert.Single(projectResources);
316
var
resource = Assert.Single(projectResources);
359
var
resource = Assert.Single(projectResources);
381
var
resource = Assert.Single(projectResources);
406
var
resource = Assert.Single(projectResources);
434
var
resource = Assert.Single(projectResources);
455
var
resource = Assert.Single(projectResources);
479
var
resource = Assert.Single(projectResources);
529
var
resource = Assert.Single(projectResources);
620
var
resource = Assert.Single(projectResources);
Aspire.Playground.Tests (5)
AppHostTests.cs (1)
41
var projects = appHost.Resources.OfType<
ProjectResource
>();
Infrastructure\DistributedApplicationExtensions.cs (2)
147
(
ProjectResource
or ExecutableResource)
211
public 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.
13
public static string GetName(this
ProjectResource
project)
TestProject.AppHost (8)
TestProgram.cs (8)
110
public IResourceBuilder<
ProjectResource
> ServiceABuilder { get; private set; }
111
public IResourceBuilder<
ProjectResource
> ServiceBBuilder { get; private set; }
112
public IResourceBuilder<
ProjectResource
> ServiceCBuilder { get; private set; }
113
public IResourceBuilder<
ProjectResource
> WorkerABuilder { get; private set; }
114
public IResourceBuilder<
ProjectResource
>? IntegrationServiceABuilder { get; private set; }
117
public List<IResourceBuilder<
ProjectResource
>> ServiceProjectBuilders => [ServiceABuilder, ServiceBBuilder, ServiceCBuilder];
147
foreach (
var
project in appModel.Resources.OfType<
ProjectResource
>())