200 references to MapGet
DefaultBuilder.SampleApp (1)
GetDocumentSample (2)
IdentitySample.ApiEndpoints (2)
Microsoft.AspNetCore.Diagnostics.Tests (5)
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)
667builder.MapGet("/api/todos", () => "").ProducesProblem(StatusCodes.Status400BadRequest);
692builder.MapGet("/api/todos", () => "").Produces<InferredJsonClass>().WithGroupName(endpointGroupName);
717builder.MapGet("/api/todos", () => "").Produces<InferredJsonClass>().ExcludeFromDescription();
739builder.MapGet("/api/todos", () => "")
791builder.MapGet("/api/todos", () => "")
892builder.MapGet("/api/todos", [ProducesResponseType(typeof(List<string>), StatusCodes.Status200OK)] () => "")
1194builder.MapGet("/api/todos/{name}", GetName);
1234builder.MapGet("/api/todos/{name:minlength(8):guid:maxlength(20)}", (string name) => "");
1262builder.MapGet("/api/todos/{id}", (int id) => "").WithDescription("A description").WithSummary("A summary");
1293builder.MapGet("/api/todos/{id}", [EndpointSummary("A summary")][EndpointDescription("A description")] (int id) => "");
1327builder.MapGet(pattern, (int Id) => "");
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (5)
Microsoft.AspNetCore.OpenApi.Tests (79)
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 (15)
18builder.MapGet("/api/todos/{id}", (int id) => { });
19builder.MapGet("/api/todos", (int id) => { });
20builder.MapGet("/api", ([FromHeader(Name = "X-Header")] string header) => { });
47builder.MapGet("/api/todos/{id}", (int id) => { });
48builder.MapGet("/api/todos/{guid}", (Guid? guid) => { });
49builder.MapGet("/api/todos/{isCompleted}", (bool isCompleted = false) => { });
73builder.MapGet("/api/todos", (int id) => { });
74builder.MapGet("/api/users", (int? id) => { });
75builder.MapGet("/api/projects", (int id = 1) => { });
99builder.MapGet("/api/todos", ([FromHeader(Name = "X-Header")] string header) => { });
100builder.MapGet("/api/users", ([FromHeader(Name = "X-Header")] Guid? header) => { });
101builder.MapGet("/api/projects", ([FromHeader(Name = "X-Header")] string header = "0000-0000-0000-0000") => { });
128builder.MapGet("/api/todos/{id}", (int id) => { });
129builder.MapGet("/api/todos/{guid}", (Guid? guid) => { });
130builder.MapGet("/api/todos/{isCompleted}", (bool isCompleted = false) => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (10)
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))] () => { })
Services\OpenApiSchemaService\OpenApiComponentService.ResponseSchemas.cs (10)
36builder.MapGet("/api", requestHandler);
57builder.MapGet("/api", () => new Todo(1, "Test Title", true, DateTime.Now));
102builder.MapGet("/api", GetTodo);
146builder.MapGet("/api", () => new TodoWithDueDate(1, "Test Title", true, DateTime.Now, DateTime.Now.AddDays(1)));
195builder.MapGet("/api", () => new Result<Todo>(true, new TodoWithDueDate(1, "Test Title", true, DateTime.Now, DateTime.Now.AddDays(1)), null));
260builder.MapGet("/api", () => new Boat { Length = 10, Make = "Type boat", Wheels = 0 });
299builder.MapGet("/api", () => TypedResults.Created("/test/1", new { Id = 1, Name = "Test", Todo = new Todo(1, "Test", true, DateTime.Now) }));
359builder.MapGet("/", () => TypedResults.Ok<List<Todo>>([new Todo(1, "Test Title", true, DateTime.Now), new Todo(2, "Test Title 2", false, DateTime.Now)]));
404builder.MapGet("/", () => TypedResults.Ok<PaginatedItems<Todo>>(new(0, 1, 5, 50, [new Todo(1, "Test Title", true, DateTime.Now), new Todo(2, "Test Title 2", false, DateTime.Now)])));
481builder.MapGet("/", () => TypedResults.ValidationProblem(new Dictionary<string, string[]>
Transformers\DocumentTransformerTests.cs (12)
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", () => { });
Transformers\SchemaTransformerTests.cs (5)
35builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
53builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
71builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
121builder.MapGet("/todo", () => new Todo(1, "Item1", false, DateTime.Now));
151builder.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");
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") });
MvcSandbox (1)
RateLimitingSample (4)
Sample (8)
Program.cs (7)
66v1.MapGet("/array-of-guids", (Guid[] guids) => guids);
70v1.MapGet("/todos/{id}", (int id) => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
73v2.MapGet("/users", () => new [] { "alice", "bob" })
78responses.MapGet("/200-add-xml", () => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
81responses.MapGet("/200-only-xml", () => new TodoWithDueDate(1, "Test todo", false, DateTime.Now.AddDays(1), DateTime.Now))
84responses.MapGet("/triangle", () => new Triangle { Color = "red", Sides = 3, Hypotenuse = 5.0 });
85responses.MapGet("/shape", () => new Shape { Color = "blue", Sides = 4 });
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)