358 references to MapGet
Aspire.Dashboard (1)
Aspire.Dashboard.Tests (3)
AzureContainerApps.ApiService (6)
AzureFunctionsEndToEnd.ApiService (4)
AzureSearch.ApiService (1)
AzureStorageEndToEnd.ApiService (1)
BicepSample.ApiService (8)
Program.cs (8)
28app.MapGet("/", async (MyDbContext context) =>
47app.MapGet("/pg", async (MyPgDbContext context) =>
66app.MapGet("/cosmos", async (CosmosClient cosmosClient) =>
97app.MapGet("/redis", async (IConnectionMultiplexer connection) =>
117app.MapGet("/blobs", async (BlobServiceClient blobServiceClient) =>
141app.MapGet("/tables", async (TableServiceClient tableServiceClient) =>
166app.MapGet("/queues", async (QueueServiceClient queueServiceClient, CancellationToken cancellationToken) =>
188app.MapGet("/servicebus", async (ServiceBusClient serviceBusClient, CancellationToken cancellationToken) =>
CatalogService (2)
CdkSample.ApiService (1)
CosmosEndToEnd.ApiService (2)
DaprServiceA (1)
DaprServiceB (1)
DatabaseMigration.ApiService (1)
DefaultBuilder.SampleApp (1)
Elasticsearch.ApiService (2)
EventHubsApi (1)
GetDocumentSample (2)
IdentitySample.ApiEndpoints (2)
Keycloak.ApiService (1)
Keycloak.Web (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
Microsoft.AspNetCore.Diagnostics.Tests (5)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.HttpLogging.Tests (9)
HttpLoggingMiddlewareTests.cs (9)
1925endpoint.MapGet("/", async (HttpContext c) =>
2031endpoint.MapGet("/attr_responseonly", [HttpLogging(HttpLoggingFields.Response)] async (HttpContext c) =>
2037endpoint.MapGet("/ext_responseonly", async (HttpContext c) =>
2043endpoint.MapGet("/attr_responseandrequest", [HttpLogging(HttpLoggingFields.All)] async (HttpContext c) =>
2050endpoint.MapGet("/ext_responseandrequest", async(HttpContext c) =>
2056endpoint.MapGet("/attr_restrictedheaders", [HttpLogging((HttpLoggingFields.Request & ~HttpLoggingFields.RequestScheme) | (HttpLoggingFields.Response & ~HttpLoggingFields.ResponseStatusCode))] async (HttpContext c) =>
2062endpoint.MapGet("/ext_restrictedheaders", async (HttpContext c) =>
2068endpoint.MapGet("/attr_restrictedsize", [HttpLogging(HttpLoggingFields.RequestBody | HttpLoggingFields.ResponseBody, RequestBodyLogLimit = 3, ResponseBodyLogLimit = 6)] async (HttpContext c) =>
2074endpoint.MapGet("/ext_restrictedsize", async (HttpContext c) =>
Microsoft.AspNetCore.Identity (2)
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
EndpointMetadataApiDescriptionProviderTest.cs (11)
835builder.MapGet("/api/todos", () => "").ProducesProblem(StatusCodes.Status400BadRequest);
860builder.MapGet("/api/todos", () => "").Produces<InferredJsonClass>().WithGroupName(endpointGroupName);
885builder.MapGet("/api/todos", () => "").Produces<InferredJsonClass>().ExcludeFromDescription();
907builder.MapGet("/api/todos", () => "")
959builder.MapGet("/api/todos", () => "")
1060builder.MapGet("/api/todos", [ProducesResponseType(typeof(List<string>), StatusCodes.Status200OK)] () => "")
1362builder.MapGet("/api/todos/{name}", GetName);
1402builder.MapGet("/api/todos/{name:minlength(8):guid:maxlength(20)}", (string name) => "");
1430builder.MapGet("/api/todos/{id}", (int id) => "").WithDescription("A description").WithSummary("A summary");
1461builder.MapGet("/api/todos/{id}", [EndpointSummary("A summary")][EndpointDescription("A description")] (int id) => "");
1495builder.MapGet(pattern, (int Id) => "");
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (6)
Microsoft.AspNetCore.OpenApi.Tests (130)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Operations.cs (11)
20builder.MapGet("/api/todos", () => { }).WithSummary(summary);
38builder.MapGet("/api/todos", () => { }).WithSummary(summary).WithSummary(summary + "1");
56builder.MapGet("/api/todos", () => { }).WithDescription(description);
74builder.MapGet("/api/todos", () => { }).WithDescription(description).WithDescription(description + "1");
91builder.MapGet("/api/todos", () => { }).WithTags(["todos", "v1"]);
115builder.MapGet("/api/todos", () => { }).WithTags(["todos", "v1"]).WithTags(["todos", "v2"]);
139builder.MapGet("/api/todos", () => { });
163builder.MapGet("/api/todos", () => { }).WithTags(["todos", "v1"]);
164builder.MapGet("/api/users", () => { }).WithTags(["users", "v1"]);
191builder.MapGet("/api/todos", () => { }).WithName("GetTodos");
209builder.MapGet("/api/todos", [EndpointName("GetTodos")] () => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (21)
19builder.MapGet("/api/todos/{id}", (int id) => { });
20builder.MapGet("/api/todos", (int id) => { });
21builder.MapGet("/api", ([FromHeader(Name = "X-Header")] string header) => { });
48builder.MapGet("/api/todos/{id}", (int id) => { });
49builder.MapGet("/api/todos/{guid}", (Guid? guid) => { });
50builder.MapGet("/api/todos/{isCompleted}", (bool isCompleted = false) => { });
74builder.MapGet("/api/todos", (int id) => { });
75builder.MapGet("/api/users", (int? id) => { });
76builder.MapGet("/api/projects", (int id = 1) => { });
100builder.MapGet("/api/todos", ([FromHeader(Name = "X-Header")] string header) => { });
101builder.MapGet("/api/users", ([FromHeader(Name = "X-Header")] Guid? header) => { });
102builder.MapGet("/api/projects", ([FromHeader(Name = "X-Header")] string header = "0000-0000-0000-0000") => { });
129builder.MapGet("/api/todos/{id}", (int id) => { });
130builder.MapGet("/api/todos/{guid}", (Guid? guid) => { });
131builder.MapGet("/api/todos/{isCompleted}", (bool isCompleted = false) => { });
176builder.MapGet("/api/accept", ([FromHeader(Name = "Accept")] string value) => { });
177builder.MapGet("/api/accept-lower", ([FromHeader(Name = "accept")] string value) => { });
178builder.MapGet("/api/authorization", ([FromHeader(Name = "Authorization")] string value) => { });
179builder.MapGet("/api/authorization-lower", ([FromHeader(Name = "authorization")] string value) => { });
180builder.MapGet("/api/content-type", ([FromHeader(Name = "Content-Type")] string value) => { });
181builder.MapGet("/api/content-type-lower", ([FromHeader(Name = "content-type")] string value) => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (12)
18builder.MapGet("/api/todos",
49builder.MapGet("/api/todos", () => { })
70builder.MapGet("/api/todos", () => { })
95builder.MapGet("/api/todos", () => { })
121builder.MapGet("/api/todos", () => { })
150builder.MapGet("/api/todos", () => { })
176builder.MapGet("/api/todos", () => { });
195builder.MapGet("/api/todos", [Produces("application/json", "application/xml")] () => new Todo(1, "Test todo", false, DateTime.Now));
223builder.MapGet("/api/todos", [ProducesDefaultResponseType(typeof(Error))] () => { });
255builder.MapGet("/api/todos", [ProducesDefaultResponseType(typeof(Error))] () => { })
318builder.MapGet("/api/todos",
349builder.MapGet("/api/todos",
Transformers\DocumentTransformerTests.cs (15)
17builder.MapGet("/todo", () => { });
18builder.MapGet("/user", () => { });
44builder.MapGet("/todo", () => { });
45builder.MapGet("/user", () => { });
61builder.MapGet("/todo", () => { });
62builder.MapGet("/user", () => { });
79builder.MapGet("/todo", () => { });
105builder.MapGet("/todo", () => { });
130builder.MapGet("/todo", () => { });
131builder.MapGet("/user", () => { });
149builder.MapGet("/todo", () => { });
150builder.MapGet("/user", () => { });
169builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
197builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
224builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
Transformers\OperationTransformerTests.cs (24)
17builder.MapGet("/todo", () => { });
18builder.MapGet("/user", () => { });
51builder.MapGet("/todo", () => { });
52builder.MapGet("/user", () => { });
144builder.MapGet("/todo", () => { });
145builder.MapGet("/user", () => { });
183builder.MapGet("/todo", () => { });
184builder.MapGet("/user", () => { });
216builder.MapGet("/todo", () => { });
217builder.MapGet("/user", () => { });
245builder.MapGet("/todo", () => { });
246builder.MapGet("/user", () => { });
275builder.MapGet("/todo", () => { });
276builder.MapGet("/user", () => { });
325builder.MapGet("/todo", () => { });
326builder.MapGet("/user", () => { });
344builder.MapGet("/todo", () => { });
345builder.MapGet("/user", () => { });
375builder.MapGet("/todo", () => { });
376builder.MapGet("/user", () => { });
407builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
434builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
461builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
462builder.MapGet("/todo-2", () => new Todo(1, "Item1", false, DateTime.Now));
Transformers\SchemaTransformerTests.cs (23)
74builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
111builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
129builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
179builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
209builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
239builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
262builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
286builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
324builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
361builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
387builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
413builder.MapGet("/todo", (int id) => { });
445builder.MapGet("/list", () => new List<int> { 1, 2, 3, 4 });
446builder.MapGet("/single", () => 1);
515builder.MapGet("/list-of-todo", () => new List<Todo> { new Todo(1, "Item1", false, DateTime.Now) });
516builder.MapGet("/list-of-int", () => new List<int> { 1, 2, 3, 4 });
551builder.MapGet("/list", () => new List<Shape> { new Triangle { Hypotenuse = 12, Color = "blue", Sides = 3 }, new Square { Area = 24, Color = "red ", Sides = 4 } });
592builder.MapGet("/list", () => new PolymorphicContainer());
633builder.MapGet("/list", () => new List<PolymorphicContainer>());
708builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
764builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
791builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
818builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
Transformers\TypeBasedTransformerLifetimeTests.cs (13)
18builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
40builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
66builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
92builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
117builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
139builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
164builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
190builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
215builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
236builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
259builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
285builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
311builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Routing.Tests (15)
Builder\GroupTest.cs (12)
28group.MapGet("/{id}", (int id, HttpContext httpContext) =>
59group.MapGet("/{id}", (string org, int id, HttpContext httpContext) =>
93group.MapGet("/", (string org, int id, HttpContext httpContext) =>
125builder.MapGroup("/{ID}").MapGroup("/{id}").MapGet("/", () => { });
158inner.MapGet("/foo", () => "Hello World!");
186group.MapGet("/foo", () => "Hello World!");
209group.MapGet("/", () =>
242group.MapGet("/foo", () => "Hello World!");
265group.MapGet("/", () =>
323inner.MapGet("/foo", () => "Hello World!").WithMetadata("/foo");
340group.MapGet("/foo", () => "foo");
341group.MapGet("/bar", () => "bar");
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Microsoft.AspNetCore.Tests (24)
WebApplicationTests.cs (24)
1579app.MapGet("/new", () => "new");
1618app.MapGet("/1", () => "1");
1669app.MapGet("/defined", () => { });
1864app.MapGet("/", () => "Hello World!").WithDisplayName("One");
1868routes.MapGet("/hi", () => "Hi World").WithDisplayName("Two");
1869routes.MapGet("/heyo", () => "Heyo World").WithDisplayName("Three");
1899app.MapGet("/", () => "Hello World").WithDisplayName("One");
1903endpoints.MapGet("/hi", () => "Hello Endpoints").WithDisplayName("Two");
1955app.MapGet("/", () => "Hello World!").WithDisplayName("One");
1964routes.MapGet("/heyo", () => "Heyo World").WithDisplayName("Three");
2031app.MapGet("/", void () => throw new InvalidOperationException("BOOM"));
2083app.MapGet("/", void () => throw new InvalidOperationException("BOOM"));
2137app.MapGet("/{parameterName}", (int parameterName) => { });
2162app.MapGet("/{parameterName}", (int parameterName) => { });
2460app.MapGet("/hello", (ClaimsPrincipal user) =>
2501app.MapGet("/hello", (ClaimsPrincipal user) => { }).AllowAnonymous();
2551app.MapGet("/products/{productId:regex(^[a-z]{{4}}\\d{{4}}$)}", (string productId) => productId).WithDisplayName("RegexRoute");
2577app.MapGet("/products/{productId:alpha:minlength(4):maxlength(4)}", (string productId) => productId).WithDisplayName("AlphaRoute");
2595app.MapGet("/products/{productId:regex(^[a-z]{{4}}\\d{{4}}$)}", (string productId) => productId).WithDisplayName("AlphaRoute");
2630app.MapGet("/products/{productId:regex(^[a-z]{{4}}\\d{{4}}$)}", (string productId) => productId).WithDisplayName("RegexRoute");
2660app.MapGet("/products/{productId:regex(^[a-z]{{4}}\\d{{4}}$)}", (string productId) => productId).WithDisplayName("RegexRoute");
2740app.MapGet("/hello", () => "hello world");
2803app.MapGet("/hello", () => "hello world");
2826endpoints.MapGet("/hello", () => "hello world");
MilvusPlayground.ApiService (2)
MinimalFormSample (2)
MinimalJwtBearerSample (2)
MinimalOpenIdConnectSample (1)
MinimalSample (11)
Program.cs (11)
15app.MapGet("/plaintext", Plaintext);
17app.MapGet("/", () => $"""
41outer.MapGet("/outerget", () => "I'm nested.");
42inner.MapGet("/innerget", () => "I'm more nested.");
59superNested.MapGet("/", (string groupName, string nestedName) =>
65app.MapGet("/json", Json).WithTags("json");
68app.MapGet("/hello/{name}", SayHello);
70app.MapGet("/null-result", IResult () => null!);
72app.MapGet("/todo/{id}", Results<Ok<Todo>, NotFound, BadRequest> (int id) => id switch
83app.MapGet("/problem/{problemType}", (string problemType) => problemType switch
95app.MapGet("/todos", () => new Todo[] { new Todo(1, "Walk the dog"), new Todo(2, "Come back home") });
Mongo.ApiService (1)
MvcSandbox (1)
MySql.ApiService (2)
Nats.ApiService (3)
OracleEndToEnd.ApiService (1)
OrleansClient (1)
OrleansServer (1)
ParameterEndToEnd.ApiService (1)
PostgresEndToEnd.ApiService (1)
ProxylessEndToEnd.ApiService (2)
Qdrant.ApiService (2)
RateLimitingSample (4)
Redis.ApiService (9)
Sample (17)
Program.cs (16)
77v1.MapGet("/array-of-guids", (Guid[] guids) => guids);
81v1.MapGet("/todos/{id}", (int id) => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
84v2.MapGet("/users", () => new [] { "alice", "bob" })
90responses.MapGet("/200-add-xml", () => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
93responses.MapGet("/200-only-xml", () => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
96responses.MapGet("/triangle", () => new Triangle { Color = "red", Sides = 3, Hypotenuse = 5.0 });
97responses.MapGet("/shape", Shape () => new Triangle { Color = "blue", Sides = 4 });
99schemas.MapGet("/typed-results", () => TypedResults.Ok(new Triangle { Color = "red", Sides = 3, Hypotenuse = 5.0 }));
100schemas.MapGet("/multiple-results", Results<Ok<Triangle>, NotFound<string>> () => Random.Shared.Next(0, 2) == 0
103schemas.MapGet("/iresult-no-produces", () => Results.Ok(new Triangle { Color = "red", Sides = 3, Hypotenuse = 5.0 }));
104schemas.MapGet("/iresult-with-produces", () => Results.Ok(new Triangle { Color = "red", Sides = 3, Hypotenuse = 5.0 }))
106schemas.MapGet("/primitives", ([Description("The ID associated with the Todo item.")] int id, [Description("The number of Todos to fetch")] int size) => { });
107schemas.MapGet("/product", (Product product) => TypedResults.Ok(product));
108schemas.MapGet("/account", (Account account) => TypedResults.Ok(account));
112schemas.MapGet("/dictionary-of-ints", () => new Dictionary<string, int> { { "one", 1 }, { "two", 2 } });
113schemas.MapGet("/frozen-dictionary-of-ints", () => ImmutableDictionary.CreateRange(new Dictionary<string, int> { { "one", 1 }, { "two", 2 } }));
Seq.ApiService (1)
SignalR.Client.FunctionalTestApp (1)
SimpleWebSiteWithWebApplicationBuilder (9)
Program.cs (9)
22app.MapGet("/", () => "Hello World");
24app.MapGet("/json", () => Json(new Person("John", 42)));
26app.MapGet("/ok-object", () => Ok(new Person("John", 42)));
28app.MapGet("/accepted-object", () => Accepted("/ok-object", new Person("John", 42)));
30app.MapGet("/many-results", (int id) =>
40app.MapGet("/problem", () => Results.Problem("Some problem"));
42app.MapGet("/environment", (IHostEnvironment environment) => environment.EnvironmentName);
43app.MapGet("/webroot", (IWebHostEnvironment environment) => environment.WebRootPath);
45app.MapGet("/greeting", (IConfiguration config) => config["Greeting"]);
SimpleWebSiteWithWebApplicationBuilderException (1)
SqlServerEndToEnd.ApiService (1)
Stress.ApiService (13)
Program.cs (13)
30app.MapGet("/", () => "Hello world");
32app.MapGet("/write-console", () =>
49app.MapGet("/increment-counter", (TestMetrics metrics) =>
58app.MapGet("/big-trace", async () =>
70app.MapGet("/trace-limit", async () =>
88app.MapGet("/http-client-requests", async (HttpClient client) =>
101app.MapGet("/log-message-limit", async ([FromServices] ILogger<Program> logger) =>
119app.MapGet("/log-message", ([FromServices] ILogger<Program> logger) =>
136app.MapGet("/many-logs", (ILoggerFactory loggerFactory, CancellationToken cancellationToken) =>
180app.MapGet("/producer-consumer", async () =>
189app.MapGet("/log-formatting", (ILoggerFactory loggerFactory) =>
237app.MapGet("/duplicate-spanid", async () =>
249app.MapGet("/multiple-traces-linked", async () =>
TestingAppHost1.MyWebApp (1)
TestProject.IntegrationServiceA (5)
TestProject.ServiceA (3)
TestProject.ServiceB (2)
TestProject.ServiceC (2)
WaitForSandbox.ApiService (1)
WebPubSubWeb (2)