186 references to MapPost
Aspire.Dashboard (5)
DashboardEndpointsBuilder.cs (2)
21endpoints.MapPost("/api/validatetoken", async (string token, HttpContext httpContext, IOptionsMonitor<DashboardOptions> dashboardOptions) => 39endpoints.MapPost("/authentication/logout", () => TypedResults.SignOut(authenticationSchemes: [CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme]));
Otlp\Http\OtlpHttpEndpointsBuilder.cs (3)
43group.MapPost("logs", static (MessageBindable<ExportLogsServiceRequest> request, OtlpLogsService service) => 51group.MapPost("traces", static (MessageBindable<ExportTraceServiceRequest> request, OtlpTraceService service) => 59group.MapPost("metrics", (MessageBindable<ExportMetricsServiceRequest> request, OtlpMetricsService service) =>
Aspire.Dashboard.Tests (1)
Integration\MockOpenIdAuthority.cs (1)
77endpoints.MapPost(
DaprServiceA (1)
Program.cs (1)
37app.MapPost("/subscriptions/weather", [Topic("pubsub", "weather")] (ILogger<Program> logger, WeatherForecastMessage message) =>
EventHubsApi (1)
Program.cs (1)
22app.MapPost("/message", async (Stream body, EventHubProducerClient producerClient) =>
Keycloak.Web (1)
LoginLogoutEndpointRouteBuilderExtensions.cs (1)
16group.MapPost("/logout", () => TypedResults.SignOut(new AuthenticationProperties { RedirectUri = "/" },
Microsoft.AspNetCore.Identity (8)
IdentityApiEndpointRouteBuilderExtensions.cs (8)
57routeGroup.MapPost("/register", async Task<Results<Ok, ValidationProblem>> 90routeGroup.MapPost("/login", async Task<Results<Ok<AccessTokenResponse>, EmptyHttpResult, ProblemHttpResult>> 122routeGroup.MapPost("/refresh", async Task<Results<Ok<AccessTokenResponse>, UnauthorizedHttpResult, SignInHttpResult, ChallengeHttpResult>> 193routeGroup.MapPost("/resendConfirmationEmail", async Task<Ok> 206routeGroup.MapPost("/forgotPassword", async Task<Results<Ok, ValidationProblem>> 225routeGroup.MapPost("/resetPassword", async Task<Results<Ok, ValidationProblem>> 260accountGroup.MapPost("/2fa", async Task<Results<Ok<TwoFactorResponse>, ValidationProblem, NotFound>> 348accountGroup.MapPost("/info", async Task<Results<Ok<InfoResponse>, ValidationProblem, NotFound>>
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (9)
EndpointMetadataApiDescriptionProviderTest.cs (9)
997builder.MapPost("/api/todos", () => "") 1031builder.MapPost("/api/todos", (InferredJsonClass inferredJsonClass) => "") 1091builder.MapPost("/api/todos", (InferredJsonClass inferredJsonClass) => ""); 1123builder.MapPost("/api/todos", (InferredJsonClass? inferredJsonClass) => ""); 1155builder.MapPost("/api/todos", [Consumes("application/xml")] (InferredJsonClass? inferredJsonClass) => ""); 1187builder.MapPost("/file/upload", (IFormFile formFile) => ""); 1216builder.MapPost("/file/upload", (IFormFile? inferredFormFile) => ""); 1245builder.MapPost("/file/upload", (IFormFile file) => Results.NoContent()); 1333builder.MapPost("/file/upload", handler);
Microsoft.AspNetCore.OpenApi.Microbenchmarks (3)
GenerationBenchmarks.cs (1)
35_builder.MapPost($"/{i}", (Todo todo) => Results.Ok());
TransformersBenchmark.cs (2)
88_builder.MapPost("/", (Todo todo) => todo); 100_builder.MapPost("/", (Todo todo) => todo);
Microsoft.AspNetCore.OpenApi.Tests (118)
Services\CreateSchemaReferenceIdTests.cs (5)
19builder.MapPost("/api", (Shape shape) => { }); 67builder.MapPost("/", (Todo todo) => { }); 116builder.MapPost("/", (Todo todo) => { }); 164builder.MapPost("/", (Todo todo) => new TodoWithDueDate(todo.Id, todo.Title, todo.Completed, todo.CreatedAt, DateTime.UtcNow)); 207builder.MapPost("/", (Todo todo) => new TodoWithDueDate(todo.Id, todo.Title, todo.Completed, todo.CreatedAt, DateTime.UtcNow));
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (2)
156builder.MapPost("/api/users", (IFormFile formFile, IFormFileCollection formFiles) => { }); 157builder.MapPost("/api/todos", (Todo todo) => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Paths.cs (3)
78builder.MapPost("/api/todos", () => { }); 109builder.MapPost("/api/todos/{id}", () => { }); 149builder.MapPost("/api/todos/{id:int}", () => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (21)
24builder.MapPost("/", ([FromForm] IFormFile formFile) => { }); 28builder.MapPost("/", (IFormFile formFile) => { }); 62builder.MapPost("/", (IFormFile? formFile) => { }); 66builder.MapPost("/", (IFormFile formFile) => { }); 100builder.MapPost("/", ([FromForm] IFormFileCollection formFileCollection) => { }); 104builder.MapPost("/", (IFormFileCollection formFileCollection) => { }); 139builder.MapPost("/", (IFormFileCollection? formFile) => { }); 143builder.MapPost("/", (IFormFileCollection formFile) => { }); 173builder.MapPost("/", (IFormFile formFile1, IFormFile formFile2) => { }); 213builder.MapPost("/", (IFormFile formFile) => { }).Accepts(typeof(IFormFile), "application/magic-foo-content-type"); 240builder.MapPost("/", [Consumes(typeof(IFormFile), "application/magic-foo-content-type")] (IFormFile formFile) => { }); 267builder.MapPost("/", (TodoWithDueDate name) => { }); 294builder.MapPost("/", (TodoWithDueDate? name) => { }); 298builder.MapPost("/", (TodoWithDueDate name) => { }); 320builder.MapPost("/", ([FromBody] string name) => { }); 342builder.MapPost("/", (string name) => { }).Accepts(typeof(string), "application/magic-foo-content-type"); 363builder.MapPost("/", [Consumes(typeof(string), "application/magic-foo-content-type")] (string name) => { }); 384builder.MapPost("/", (string name) => { }); 403builder.MapPost("/form", ([FromForm] Todo todo) => { }); 460builder.MapPost("/form", ([FromForm] int id, [FromForm] DateTime date, [FromForm] short? value) => { }); 562builder.MapPost("/form", ([FromForm] Todo todo, [FromForm] Error error) => { });
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (7)
17builder.MapPost("/api", (Shape shape) => { }); 54builder.MapPost("/api", (WeatherForecastBase forecast) => { }); 99builder.MapPost("/api", (Person person) => { }); 138builder.MapPost("/api", (Color color) => { }); 177builder.MapPost("/api", (Pet pet) => { }); 230builder.MapPost("/api", (Organism color) => { }); 265builder.MapPost("/api", (Employee color) => { });
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (24)
24builder.MapPost("/", (Todo todo) => { }); 76builder.MapPost("/", ([FromForm] ProjectBoard todo) => { }); 80builder.MapPost("/", (ProjectBoard todo) => { }); 128builder.MapPost("/required-poco", ([Required] Todo todo) => { }); 129builder.MapPost("/non-required-poco", (Todo todo) => { }); 130builder.MapPost("/required-form", ([Required][FromForm] Todo todo) => { }); 131builder.MapPost("/non-required-form", ([FromForm] Todo todo) => { }); 132builder.MapPost("/", (ProjectBoard todo) => { }); 159builder.MapPost("/required-properties", (RequiredTodo todo) => { }); 183builder.MapPost("/stream", ([FromBody] Stream stream) => { }); 184builder.MapPost("/pipereader", ([FromBody] PipeReader stream) => { }); 209builder.MapPost("/proposal", (Proposal stream) => { }); 240builder.MapPost("/enumerable-todo", (IEnumerable<Todo> todo) => { }); 241builder.MapPost("/array-todo", (Todo[] todo) => { }); 303builder.MapPost("/api", (Boat boat) => { }); 343builder.MapPost("/api", (DescriptionTodo todo) => { }); 391builder.MapPost("/api", ([Description("The todo item to create.")] DescriptionTodo todo) => { }); 409builder.MapPost("/api", (NullablePropertiesType type) => { }); 461builder.MapPost("/api", (NestedType type) => { }); 506builder.MapPost("/api", (NestedType type) => { }); 570builder.MapPost("/api", ([FromForm] string? name, [FromForm] int? number, [FromForm] int[]? ids) => { }); 606builder.MapPost("/api", (ExampleWithDisallowedUnmappedMembers type) => { }); 632builder.MapPost("/api", (ExampleWithSkippedUnmappedMembers type) => { }); 670builder.MapPost("/api", (Parent parent) => { });
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (16)
21builder.MapPost("/api", (IFormFile value) => { }); 22builder.MapPost("/api-2", (IFormFile value) => { }); 73builder.MapPost("/api", (Todo todo) => TypedResults.Ok(todo)); 126builder.MapPost("/api", (Todo[] todo) => { }); 127builder.MapPost("/api-2", (Dictionary<string, Todo> todo) => { }); 183builder.MapPost("/api", (IFormFile resume, [FromForm] Todo todo) => { }); 184builder.MapPost("/api-2", ([FromForm] string name, [FromForm] Todo todo2) => { }); 219builder.MapPost("/api", (IEnumerable<Todo> todo) => { }); 220builder.MapPost("/api-2", (Todo[] todo) => { }); 273builder.MapPost("/todo", (Todo todo) => { }); 307builder.MapPost("/api", () => new TodoListContainer()); 308builder.MapPost("/api-2", () => new TodoListContainer()); 309builder.MapPost("/api-3", (Todo todo) => { }); 370builder.MapPost("/", (Level1 item) => { }); 415builder.MapPost("/", (DeeplyNestedLevel1 item) => { }); 433builder.MapPost("/", (DeeplyNestedLevel1 item) => { });
Transformers\SchemaTransformerTests.cs (15)
19builder.MapPost("/todo", (Todo todo) => { }); 150builder.MapPost("/todo", (Todo todo) => { }); 178builder.MapPost("/todo", (Todo todo) => { }); 208builder.MapPost("/todo", (Todo todo) => { }); 238builder.MapPost("/todo", (Todo todo) => { }); 261builder.MapPost("/todo", (Todo todo) => { }); 285builder.MapPost("/todo", (Todo todo) => { }); 323builder.MapPost("/todo", (Todo todo) => { }); 360builder.MapPost("/todo", (Todo todo) => { }); 386builder.MapPost("/todo", (Todo todo) => { }); 412builder.MapPost("/todo", (Todo todo) => { }); 480builder.MapPost("/shape", (Shape todo) => { }); 481builder.MapPost("/triangle", (Triangle todo) => { }); 674builder.MapPost("/todo", ([FromForm] Todo todo, [FromForm] Error error) => { }); 709builder.MapPost("/shape", (Shape shape) => { });
Transformers\TypeBasedTransformerLifetimeTests.cs (25)
19builder.MapPost("/shape", (Shape shape) => { }); 20builder.MapPost("/triangle", (Triangle triangle) => { }); 41builder.MapPost("/shape", (Shape shape) => { }); 42builder.MapPost("/triangle", (Triangle triangle) => { }); 67builder.MapPost("/shape", (Shape shape) => { }); 68builder.MapPost("/triangle", (Triangle triangle) => { }); 93builder.MapPost("/shape", (Shape shape) => { }); 94builder.MapPost("/triangle", (Triangle triangle) => { }); 118builder.MapPost("/shape", (Shape shape) => { }); 119builder.MapPost("/triangle", (Triangle triangle) => { }); 140builder.MapPost("/shape", (Shape shape) => { }); 165builder.MapPost("/shape", (Shape shape) => { }); 166builder.MapPost("/triangle", (Triangle triangle) => { }); 191builder.MapPost("/shape", (Shape shape) => { }); 192builder.MapPost("/triangle", (Triangle triangle) => { }); 216builder.MapPost("/shape", (Shape shape) => { }); 217builder.MapPost("/triangle", (Triangle triangle) => { }); 237builder.MapPost("/shape", (Shape shape) => { }); 238builder.MapPost("/triangle", (Triangle triangle) => { }); 260builder.MapPost("/shape", (Shape shape) => { }); 261builder.MapPost("/triangle", (Triangle triangle) => { }); 286builder.MapPost("/shape", (Shape shape) => { }); 287builder.MapPost("/triangle", (Triangle triangle) => { }); 312builder.MapPost("/shape", (Shape shape) => { }); 313builder.MapPost("/triangle", (Triangle triangle) => { });
Microsoft.AspNetCore.Routing.FunctionalTests (14)
MinimalFormTests.cs (13)
35b.MapPost("/todo", ([FromForm] Todo todo) => todo)); 145b.MapPost("/todo", ([FromForm] Todo todo) => todo)); 184b.MapPost("/todo", ([FromForm] Todo todo) => todo)); 230b.MapPost("/todo", ([FromForm] Todo todo) => todo)); 260b.MapPost("/todo", ([FromForm] Todo todo) => todo) 307group.MapPost("", ([FromForm] Todo todo) => todo); 456b.MapPost("/todo", ([FromForm] Todo todo) => todo).WithMetadata(new RequestSizeLimitMetadata(hasLimit ? 2 : null))); 514b.MapPost("/todo", ([FromForm] Dictionary<string, string> todo) => todo) 565g.MapPost("/1", ([FromForm] Dictionary<string, string> todo) => todo) 617g.MapPost("/1", ([FromForm] Dictionary<string, string> todo) => todo) 667b.MapPost("/todo", ([FromForm] Todo todo) => todo) 711app.UseEndpoints(b => b.MapPost("/", (IFormFile formFile) => "ok").DisableAntiforgery()); 738app.UseEndpoints(b => b.MapPost("/", (IFormFile formFile) => "ok").DisableAntiforgery());
RouteHandlerTest.cs (1)
32b.MapPost("/EchoTodo/{id}",
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
38routes.MapPost(template, action);
MinimalFormSample (1)
Program.cs (1)
52app.MapPost("/todo", [ValidateAntiForgeryToken] ([FromForm] Todo todo) => Results.Ok(todo));
MinimalSample (1)
Program.cs (1)
94app.MapPost("/todos", (TodoBindable todo) => todo);
MySql.ApiService (1)
Program.cs (1)
43app.MapPost("/catalog", async (CatalogItem item, MySqlConnection db) =>
Nats.ApiService (2)
Program.cs (2)
29app.MapPost("/stream", async (StreamConfig config, INatsJSContext jetStream) => 42app.MapPost("/publish/", async (AppEvent @event, INatsJSContext jetStream) =>
OrleansClient (1)
Program.cs (1)
17app.MapPost("/counter/{grainId}", async (IClusterClient client, string grainId) =>
OutputCachingSample (1)
Startup.cs (1)
36app.MapPost("/purge/{tag}", async (IOutputCacheStore cache, string tag) =>
RateLimitingSample (1)
Program.cs (1)
71app.MapPost("/todoitems", async (Todo todo, TodoDb db) =>
Sample (13)
Program.cs (13)
57forms.MapPost("/form-file", (IFormFile resume) => Results.Ok(resume.FileName)); 58forms.MapPost("/form-files", (IFormFileCollection files) => Results.Ok(files.Count)); 59forms.MapPost("/form-file-multiple", (IFormFile resume, IFormFileCollection files) => Results.Ok(files.Count + resume.FileName)); 64forms.MapPost("/form-todo", ([FromForm] Todo todo) => Results.Ok(todo)); 65forms.MapPost("/forms-pocos-and-files", ([FromForm] Todo todo, IFormFile file) => Results.Ok(new { Todo = todo, File = file.FileName })); 79v1.MapPost("/todos", (Todo todo) => Results.Created($"/todos/{todo.Id}", todo)) 87v2.MapPost("/users", () => Results.Created("/users/1", new { Id = 1, Name = "Test user" })) 109schemas.MapPost("/array-of-ints", (int[] values) => values.Sum()); 110schemas.MapPost("/list-of-ints", (List<int> values) => values.Count); 111schemas.MapPost("/ienumerable-of-ints", (IEnumerable<int> values) => values.Count()); 114schemas.MapPost("/shape", (Shape shape) => { }); 115schemas.MapPost("/weatherforecastbase", (WeatherForecastBase forecast) => { }); 116schemas.MapPost("/person", (Person person) => { });
SimpleWebSiteWithWebApplicationBuilder (3)
Program.cs (3)
47app.MapPost("/accepts-default", (Person person) => Results.Ok(person.Name)); 48app.MapPost("/accepts-xml", () => Accepted()).Accepts<Person>("application/xml"); 50app.MapPost("/fileupload", async (IFormFile file) =>