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