10 writes to Data
Aspire.Hosting (9)
ApplicationModel\CommandsConfigurationExtensions.cs (1)
398Data = new CommandResultData
ApplicationModel\ResourceCommandAnnotation.cs (5)
235public static ExecuteCommandResult Success(string message, string result, CommandResultFormat resultFormat = CommandResultFormat.Text) => new() { Success = true, Message = message, Data = new CommandResultData { Value = result, Format = resultFormat } }; 249public static ExecuteCommandResult Success(string message, string result, CommandResultFormat resultFormat, bool displayImmediately) => new() { Success = true, Message = message, Data = new CommandResultData { Value = result, Format = resultFormat, DisplayImmediately = displayImmediately } }; 256public static ExecuteCommandResult Success(string message, CommandResultData value) => new() { Success = true, Message = message, Data = value }; 270public static ExecuteCommandResult Failure(string errorMessage, string result, CommandResultFormat resultFormat = CommandResultFormat.Text) => new() { Success = false, Message = errorMessage, Data = new CommandResultData { Value = result, Format = resultFormat } }; 277public static ExecuteCommandResult Failure(string errorMessage, CommandResultData value) => new() { Success = false, Message = errorMessage, Data = value };
ApplicationModel\ResourceCommandService.cs (1)
191Data = successWithResult?.Data
ResourceBuilderExtensions.cs (2)
3506: new ExecuteCommandResult { Success = true, Data = resultData }; 3885? new ExecuteCommandResult { Success = true, Data = new CommandResultData { Value = result, Format = resultFormat } }
Aspire.Hosting.Tests (1)
WithProcessCommandTests.cs (1)
778Data = new CommandResultData
100 references to Data
Aspire.Hosting (6)
ApplicationModel\CommandsConfigurationExtensions.cs (1)
388if (result.Data is not null || string.IsNullOrWhiteSpace(output))
ApplicationModel\ResourceCommandAnnotation.cs (1)
247/// <see cref="ExecuteCommandResult.Data"/>.
ApplicationModel\ResourceCommandService.cs (2)
187var successWithResult = results.FirstOrDefault(r => r.Data is not null); 191Data = successWithResult?.Data
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
329Value = result.Data is { } v ? new ExecuteResourceCommandResult
Dashboard\DashboardServiceData.cs (1)
145return (result.Success ? ExecuteCommandResultType.Success : ExecuteCommandResultType.Failure, result.Message, result.Data, result.InvalidArguments);
Aspire.Hosting.Azure.Tests (7)
AzureEnvironmentResourceExtensionsTests.cs (7)
847Assert.NotNull(result.Data); 848Assert.True(result.Data!.DisplayImmediately); 1192Assert.True(result.Data!.DisplayImmediately); 3479Assert.Contains("cli-rg-é", result.Data!.Value, StringComparison.Ordinal); 3480Assert.DoesNotContain("\\u00E9", result.Data.Value, StringComparison.OrdinalIgnoreCase); 5026Assert.NotNull(result.Data); 5027var data = result.Data!;
Aspire.Hosting.Browsers.Tests (6)
BrowserLogsBuilderExtensionsTests.cs (6)
799Assert.NotNull(result.Data); 800Assert.Equal(CommandResultFormat.Json, result.Data.Format); 801Assert.True(result.Data.DisplayImmediately); 803using var document = JsonDocument.Parse(result.Data.Value); 890Assert.NotNull(result.Data); 892using var document = JsonDocument.Parse(result.Data.Value);
Aspire.Hosting.DevTunnels.Tests (2)
DevTunnelResourceBuilderExtensionsTests.cs (2)
496Assert.Null(result.Data); 533Assert.Null(result.Data);
Aspire.Hosting.Tests (79)
ResourceCommandServiceTests.cs (21)
485Assert.NotNull(result.Data); 486Assert.Equal("{\"token\": \"abc123\"}", result.Data.Value); 487Assert.Equal(CommandResultFormat.Json, result.Data.Format); 506Assert.Null(result.Data); 1629Assert.NotNull(result.Data); 1630Assert.StartsWith("token-", result.Data.Value); 1631Assert.Equal(CommandResultFormat.Text, result.Data.Format); 1655Assert.NotNull(result.Data); 1656Assert.Equal(CommandResultFormat.Text, result.Data.Format); 1657Assert.Contains("[build] Building project...", result.Data.Value); 1658Assert.Contains(rebuildOutputMarker, result.Data.Value); 1667Assert.NotNull(result.Data); 1668Assert.Equal("{\"key\": \"value\"}", result.Data.Value); 1669Assert.Equal(CommandResultFormat.Json, result.Data.Format); 1678Assert.NotNull(result.Data); 1679Assert.Equal("{\"key\": \"value\"}", result.Data.Value); 1680Assert.Equal(CommandResultFormat.Json, result.Data.Format); 1681Assert.True(result.Data.DisplayImmediately); 1690Assert.NotNull(result.Data); 1691Assert.Equal("hello world", result.Data.Value); 1692Assert.Equal(CommandResultFormat.Text, result.Data.Format);
WithHttpCommandTests.cs (14)
59Assert.Null(result.Data); 77Assert.Equal("""{"token":"abc123"}""", result.Data?.Value); 78Assert.Equal(CommandResultFormat.Json, result.Data?.Format); 96Assert.Equal("invalid request", result.Data?.Value); 97Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 821Assert.Null(result.Data); 847Assert.Equal("""{"token":"abc123"}""", result.Data?.Value); 848Assert.Equal(CommandResultFormat.Json, result.Data?.Format); 875Assert.Equal("invalid request", result.Data?.Value); 876Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 902Assert.Equal("""{"token":"abc123"}""", result.Data?.Value); 903Assert.Equal(CommandResultFormat.Json, result.Data?.Format); 930Assert.Equal("invalid request", result.Data?.Value); 931Assert.Equal(CommandResultFormat.Text, result.Data?.Format);
WithProcessCommandTests.cs (44)
127Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 128Assert.False(result.Data?.DisplayImmediately); 129Assert.Contains("export-line", result.Data?.Value); 193Assert.Contains("options-callback-line", result.Data?.Value); 272Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 273Assert.False(result.Data?.DisplayImmediately); 274Assert.Contains("factory-line", result.Data?.Value); 316Assert.Contains("factory-accepted-output", result.Data?.Value); 387Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 388Assert.Contains("hello-from-argument", result.Data?.Value); 492Assert.Contains("async-factory-output", result.Data?.Value); 526Assert.Contains("first-output", firstResult.Data?.Value); 530Assert.Contains("second-output", secondResult.Data?.Value); 569Assert.NotNull(result.Data); 570Assert.Equal(CommandResultFormat.Text, result.Data.Format); 571Assert.True(result.Data.DisplayImmediately); 572Assert.Contains("Command output truncated: showing last 3 of 5 lines.", result.Data.Value); 573Assert.DoesNotContain("line-1", result.Data.Value); 574Assert.DoesNotContain("line-2", result.Data.Value); 575Assert.Contains("line-3", result.Data.Value); 576Assert.Contains("line-5", result.Data.Value); 602Assert.NotNull(result.Data); 603Assert.False(result.Data.DisplayImmediately); 604Assert.Contains("display-immediately-output", result.Data.Value); 626Assert.Null(result.Data); 650Assert.Null(result.Data); 676Assert.Contains("accepted-output", result.Data?.Value); 714Assert.NotNull(result.Data); 715Assert.False(result.Data.DisplayImmediately); 716Assert.Contains("failure-output", result.Data.Value); 738Assert.Contains("stdout-line", result.Data?.Value); 739Assert.Contains("stderr-line", result.Data?.Value); 794Assert.Equal(CommandResultFormat.Json, result.Data?.Format); 795Assert.False(result.Data?.DisplayImmediately); 796Assert.Equal("""{"status":"custom"}""", result.Data?.Value); 836Assert.NotNull(result.Data); 839result.Data.Value.Split(Environment.NewLine, StringSplitOptions.None)); 869Assert.Equal(CommandResultFormat.Text, result.Data?.Format); 870Assert.True(result.Data?.DisplayImmediately); 871Assert.Contains("failed-line", result.Data?.Value); 1090Assert.NotNull(result.Data); 1091Assert.False(result.Data.DisplayImmediately); 1092Assert.Contains("export-options-output", result.Data.Value); 1128Assert.Contains("export-accepted-output", result.Data?.Value);