65 references to Resource
Aspire.Hosting (31)
ApplicationModel\CustomResourceKnownProperties.cs (3)
16public static string Source { get; } = KnownProperties.Resource.Source; 21public static string ConnectionString { get; } = KnownProperties.Resource.ConnectionString; 26public static string ConnectionProperties { get; } = KnownProperties.Resource.ConnectionProperties;
ApplicationModel\DotnetToolResource.cs (1)
53yield return new(KnownProperties.Resource.Source, toolConfig.PackageId);
ApplicationModel\ResourceNotificationService.cs (5)
615Properties = s.Properties.SetResourceProperty(KnownProperties.Resource.WaitingFor, waitingFor) 630Properties = s.Properties.RemoveResourceProperty(KnownProperties.Resource.WaitingFor) 846Properties = newState.Properties.RemoveResourceProperty(KnownProperties.Resource.WaitingFor) 860Properties = newState.Properties.SetResourceProperty(KnownProperties.Resource.ExcludeFromMcp, true) 1359if (string.Equals(property.Name, KnownProperties.Resource.WaitingFor, StringComparisons.ResourcePropertyName))
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
1165if (string.Equals(prop.Name, KnownProperties.Resource.WaitingFor, StringComparisons.ResourcePropertyName))
Dashboard\ResourceSnapshot.cs (10)
42yield return (KnownProperties.Resource.Uid, Value.ForString(Uid), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 43yield return (KnownProperties.Resource.Name, Value.ForString(Name), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 44yield return (KnownProperties.Resource.Type, Value.ForString(ResourceType), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 45yield return (KnownProperties.Resource.DisplayName, Value.ForString(DisplayName), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 46yield return (KnownProperties.Resource.State, State is null ? Value.ForNull() : Value.ForString(State), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 47yield return (KnownProperties.Resource.ExitCode, ExitCode is null ? Value.ForNull() : Value.ForString(ExitCode.Value.ToString("D", CultureInfo.InvariantCulture)), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 48yield return (KnownProperties.Resource.CreateTime, CreationTimeStamp is null ? Value.ForNull() : Value.ForString(CreationTimeStamp.Value.ToString("O")), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 49yield return (KnownProperties.Resource.StartTime, StartTimeStamp is null ? Value.ForNull() : Value.ForString(StartTimeStamp.Value.ToString("O")), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 50yield return (KnownProperties.Resource.StopTime, StopTimeStamp is null ? Value.ForNull() : Value.ForString(StopTimeStamp.Value.ToString("O")), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null); 51yield return (KnownProperties.Resource.HealthState, CustomResourceSnapshot.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null);
Dcp\ResourceSnapshotBuilder.cs (10)
62new(KnownProperties.Resource.AppArgs, launchArguments?.Args) { IsSensitive = launchArguments?.IsSensitive ?? false }, 63new(KnownProperties.Resource.AppArgsSensitivity, launchArguments?.ArgsAreSensitive) { IsSensitive = launchArguments?.IsSensitive ?? false }, 122new(KnownProperties.Resource.AppArgs, launchArguments?.Args) { IsSensitive = launchArguments?.IsSensitive ?? false }, 123new(KnownProperties.Resource.AppArgsSensitivity, launchArguments?.ArgsAreSensitive) { IsSensitive = launchArguments?.IsSensitive ?? false }, 174? previous.Properties.SetResourceProperty(KnownProperties.Resource.LaunchConfigurationType, launchConfigurationType) 175: previous.Properties.RemoveResourceProperty(KnownProperties.Resource.LaunchConfigurationType); 191new(KnownProperties.Resource.AppArgs, launchArguments?.Args) { IsSensitive = launchArguments?.IsSensitive ?? false }, 192new(KnownProperties.Resource.AppArgsSensitivity, launchArguments?.ArgsAreSensitive) { IsSensitive = launchArguments?.IsSensitive ?? false }, 213new(KnownProperties.Resource.AppArgs, launchArguments?.Args) { IsSensitive = launchArguments?.IsSensitive ?? false }, 214new(KnownProperties.Resource.AppArgsSensitivity, launchArguments?.ArgsAreSensitive) { IsSensitive = launchArguments?.IsSensitive ?? false },
Orchestrator\ApplicationOrchestrator.cs (1)
733Properties = parent is null ? s.Properties : s.Properties.SetResourceProperty(KnownProperties.Resource.ParentName, parent.GetResolvedResourceNames()[0]),
Aspire.Hosting.Tests (34)
Dashboard\ResourcePublisherTests.cs (2)
19KnownProperties.Resource.ConnectionProperties, 26var property = Assert.Single(snapshot.Properties, p => p.Name == KnownProperties.Resource.ConnectionProperties);
Dcp\DcpExecutorTests.cs (2)
400Assert.Equal(["--port", "52731"], GetEnumerablePropertyValue<string>(snapshot, KnownProperties.Resource.AppArgs).ToArray()); 446Assert.Equal(["--port", "5678"], GetEnumerablePropertyValue<string>(snapshot, KnownProperties.Resource.AppArgs).ToArray());
Dcp\ResourceSnapshotBuilderTests.cs (5)
194Assert.Equal(["--secret", "resolved-secret"], GetEnumerablePropertyValue<string>(snapshot, KnownProperties.Resource.AppArgs).ToArray()); 195Assert.Equal([0, 1], GetEnumerablePropertyValue<int>(snapshot, KnownProperties.Resource.AppArgsSensitivity).ToArray()); 196Assert.True(GetProperty(snapshot, KnownProperties.Resource.AppArgs).IsSensitive); 197Assert.True(GetProperty(snapshot, KnownProperties.Resource.AppArgsSensitivity).IsSensitive); 212Assert.Equal(["-port", DcpTemplateArgument], GetEnumerablePropertyValue<string>(snapshot, KnownProperties.Resource.AppArgs).ToArray());
DotnetToolResourceTests.cs (1)
24var sourceProperty = properties[KnownProperties.Resource.Source];
Orchestrator\ApplicationOrchestratorTests.cs (15)
57childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 105childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 206childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 210nestedChildParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 214child2ParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 275childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 323projectBParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 476Assert.Equal(KnownProperties.Resource.ConnectionString, connectionStringProperty.Name); 482Assert.Equal(KnownProperties.Resource.ConnectionProperties, connectionPropertiesProperty.Name); 1053var waitingFor = waitingEvent.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.WaitingFor)?.Value; 1413childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 1417child2ParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 1470childParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 1474child2ParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString(); 1524childProjectParentResourceId = item.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.ParentName)?.Value?.ToString();
ResourceNotificationTests.cs (9)
400Assert.DoesNotContain(completedWaitingEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 458Assert.DoesNotContain(completedWaitingEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 506Assert.DoesNotContain(completedWaitingEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 780Assert.DoesNotContain(completedWaitingEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 792Properties = [new ResourcePropertySnapshot(KnownProperties.Resource.WaitingFor, new[] { "dependency" })] 796Assert.Contains(waitingEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 804Assert.DoesNotContain(runningEvent.Snapshot.Properties, p => p.Name == KnownProperties.Resource.WaitingFor); 822Properties = [new ResourcePropertySnapshot(KnownProperties.Resource.WaitingFor, new[] { dependency.Name })] 1621var property = resourceEvent.Snapshot.Properties.SingleOrDefault(p => p.Name == KnownProperties.Resource.WaitingFor);