22 references to HttpCommandResultMode
Aspire.Hosting (9)
ApplicationModel\HttpCommandOptions.cs (3)
70
/// when <see cref="GetCommandResult"/> is not specified. The default is <see cref="
HttpCommandResultMode
.None"/>.
72
public
HttpCommandResultMode
ResultMode { get; set; }
134
public
HttpCommandResultMode
ResultMode { get; set; }
ResourceBuilderExtensions.cs (6)
3895
private static bool TryGetHttpCommandResultFormat(
HttpCommandResultMode
resultMode, MediaTypeHeaderValue? contentType, out CommandResultFormat resultFormat)
3901
case
HttpCommandResultMode
.None:
3903
case
HttpCommandResultMode
.Json:
3906
case
HttpCommandResultMode
.Text:
3909
case
HttpCommandResultMode
.Auto:
3912
throw new InvalidOperationException($"Unsupported {nameof(
HttpCommandResultMode
)} value '{resultMode}'.");
Aspire.Hosting.Tests (10)
WithHttpCommandTests.cs (10)
22
Assert.Equal(0, (int)
HttpCommandResultMode
.None);
23
Assert.Equal(1, (int)
HttpCommandResultMode
.Auto);
24
Assert.Equal(2, (int)
HttpCommandResultMode
.Json);
25
Assert.Equal(3, (int)
HttpCommandResultMode
.Text);
72
ResultMode =
HttpCommandResultMode
.Json
91
ResultMode =
HttpCommandResultMode
.Auto
835
service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode =
HttpCommandResultMode
.Json });
862
service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode =
HttpCommandResultMode
.Text });
890
service.WithHttpCommand("/token", "Generate Token", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode =
HttpCommandResultMode
.Auto });
917
service.WithHttpCommand("/text", "Get Text", commandName: "mycommand", commandOptions: new() { HttpClientName = "commandclient", ResultMode =
HttpCommandResultMode
.Auto });
Stress.AppHost (3)
CommandResources.cs (3)
907
serviceBuilder.WithHttpCommand("/http-command-auto-result", "HTTP command auto result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode =
HttpCommandResultMode
.Auto, Description = "Run an HTTP command and infer the result format from the response content type" });
908
serviceBuilder.WithHttpCommand("/http-command-json-result", "HTTP command JSON result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode =
HttpCommandResultMode
.Json, Description = "Run an HTTP command and flow the JSON response back to the caller" });
909
serviceBuilder.WithHttpCommand("/http-command-text-result", "HTTP command text result", commandOptions: new() { Method = HttpMethod.Get, IconName = "ContentViewGalleryLightning", ResultMode =
HttpCommandResultMode
.Text, Description = "Run an HTTP command and flow the plain-text response back to the caller" });