Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

I am working on a small ASP.NET Core 8 Web API using the Minimal API template. I'd like to be able to skip my ApiKeyAuthenticationHandler for the health check (/health path) to avoid noise in the log ...
Karnalta's user avatar
  • 538
1 vote
0 answers
70 views

I have a simple .NET 10 Minimal API that I'm testing with SwaggerUI as : public class Input { public string? StringVal { get; set; } = ""; public string[] ArrayVals { get; set; } = [...
TheLovelySausage's user avatar
Best practices
4 votes
2 replies
142 views

I have a .NET Core minimal API that has grown to 45+ MapGet/MapPost endpoints in Program.cs, and it's becoming difficult to navigate. All endpoints share several variables declared in Program.cs (...
Peter's user avatar
  • 2,336
3 votes
1 answer
88 views

In endpoint filters, I often want to get the request, for example FooRequest. I know there will be only one of these in the arguments list, so using GetArgument that requires passing an index integer ...
Max's user avatar
  • 757
1 vote
1 answer
91 views

I have a WPF app that host a Minimal Web API. To start the Minimal Web API, the following code is used: public async Task StartWebApi(IEnumerable<string> urls, CancellationToken token) { var ...
SomeBody's user avatar
  • 8,910
1 vote
2 answers
109 views

I am attempting to migrate an ASP.NET Core application from using IWebHostBuilder to WebApplicationBuilder. I understand that you can no longer call UseStartup. One useful thing about the old model ...
Andrew Shepherd's user avatar
0 votes
0 answers
68 views

I'm trying to convert this C# example from the .NET Minimal APIs Quick Reference that sets up a keyed service. var builder = WebApplication.CreateBuilder(args); builder.Services.AddKeyedSingleton<...
Adam's user avatar
  • 1,151
4 votes
1 answer
131 views

I’m using ASP.NET Core Minimal API. I have an endpoint where I want to receive an IFormFile along with a Dictionary<string, string> property in the same request. I set the Accepts<...
Dmytro Kotenko's user avatar
1 vote
1 answer
80 views

app.MapGet("/bus_schedule", (string user_stop_name, string user_route) => { public class Bus { public string[3] arrival_time { get; set; } public string route { ...
Serro's user avatar
  • 11
1 vote
1 answer
51 views

I am trying to get cache working on my API call but every time I do a request it goes straight into my lookup service code. I have two services, stock and productlookup. The stock calls the ...
James Andrew Smith's user avatar
0 votes
1 answer
86 views

I’m building a .NET 8 minimal API endpoint that returns paginated results using OData. My service method returns a PageResult like this: public async Task<PageResult<ItemDto>> GetItemList(...
Rasik's user avatar
  • 2,529
0 votes
1 answer
105 views

I'm working on a backend that uses both ASP.NET Core Minimal API and Azure Functions (TimerTrigger and HttpTrigger). I want to run both locally for development and testing. However, I'm running into ...
smit patel's user avatar
1 vote
1 answer
245 views

During local development, my ASP.NET Core 8 Minimal API project is operating without any issues. Swagger opens at /swagger, all endpoints are visible, and everything is testable directly from the user ...
Zeel Gabriels's user avatar
1 vote
0 answers
166 views

I have written a Minimal API in C# running on .NET 8. It is supposed to return a single record and update a table in our database, indicating that a record has been processed. The nature of the ...
mdolunt's user avatar
  • 11
0 votes
1 answer
53 views

I am using Telerik Blazor TelerikFileSelect component to select an excel file and send it as a StreamContent to ASP.NET Core Minimal API endpoint. I do not see any issues when I send a 13 KB Excel ...
Gouri's user avatar
  • 51
2 votes
0 answers
105 views

I'm working on an ASP.NET Core Minimal API. We are using the MiniValidation library for request validation on our endpoints. We have some strict linting that means for reference types we need to ...
rcarrington's user avatar
  • 1,722
0 votes
1 answer
163 views

I am writing ASP.NET Core 9 application using the minimal API. In this application I have a route that accepts an absolute URL as part of the route. This works when I run the ASP.NET application ...
Marcel V.'s user avatar
  • 192
2 votes
1 answer
553 views

I'm using fast endpoints in a .NET 9.0 web api project and I'm finding myself writing a lot of boiler plate to get the basic functions up and running. I'm writing just my basic database CRUD and I'm ...
Zac Andersen's user avatar
1 vote
1 answer
204 views

I have a Blazor web app that uses minimal API endpoints for when it's in WASM rendering mode. These endpoints simply pass the request to server-side services that are called directly when in server ...
Avrohom Yisroel's user avatar
0 votes
0 answers
25 views

I'm using ASP.NET Core Identity with AddIdentityApiEndpoints<User>() and bearer token authentication configured via BearerTokenOptions. In my login use case, I use the following: await ...
Victor's user avatar
  • 1
1 vote
2 answers
170 views

I'm building an ASP.NET Core 9 Minimal API where the endpoint I'm working on is receiving form data, but it is failing to bind the value of one of the properties. The property is a strongly typed id ...
Gup3rSuR4c's user avatar
  • 9,530
3 votes
1 answer
406 views

I want to have my OpenAPI json spec to use camel case in all query string parameters for my routes. So far the only way I managed to get this working was by using [FromQuery(Name = "camelCase&...
Bruno Casarotti's user avatar
2 votes
0 answers
224 views

I'm encountering an issue with my integration tests that use TestContainers and Respawn. The tests work perfectly in Debug mode (and within seconds) but fail in Release mode with the following timeout ...
Doidel's user avatar
  • 339
1 vote
3 answers
254 views

Building a basic ASP.NET Core Minimal API, I was surprised by the fact that if an endpoint returns a Task, the request does not return until the Task is done: var builder = WebApplication....
Pragmateek's user avatar
  • 13.6k
1 vote
0 answers
238 views

I created an ASP.NET Core 9 Minimal API that is consumed by an Angular app. Both applications are on a IIS site and the Angular app is calling the backend with http://localhost/api/.... Both are on ...
Ayrton Albuquerque's user avatar
0 votes
1 answer
349 views

I have a C# / ASP.NET Core Minimal API app with Swagger generating an OpenAPI spec. In order to match the publish yml, I need to add a server with path and remove the path elements from individual ...
James's user avatar
  • 465
0 votes
1 answer
167 views

I trying to consume a .NET Core Minimal Api endpoint, which is secured with Bearer tokens, via the .http client in Visual Studio. I'm setting a valid Authorization: Bearer <token> in the request ...
Rizan Zaky's user avatar
  • 4,702
1 vote
0 answers
249 views

I have created a .NET 9 minimal API for work and everything works fine while debugging in vscode / Kestrel but when I deploy the application to IIS 10, all of my BadRequest responses does not contain ...
Matt Baech's user avatar
-2 votes
4 answers
421 views

I have background worker which implements BackgroundService. I added this service in the beginning of my program.cs with builder.Services.AddHostedService<MyService>(); How can I get ...
Kamsiinov's user avatar
  • 1,501
0 votes
0 answers
164 views

I have a problem when I switch version in the swagger UI. I see endpoints not related to that version they are associated with. For example I have 3 endpoints under version 1 but 1 endpoint under ...
James Andrew Smith's user avatar
0 votes
0 answers
55 views

We have our implementation of OAuth protocol in an ASP.NET Core 9 Minimal API. Everything works fine in Chrome and Edge. In Firefox (v 135) it works as well but sometimes (e.g 1 of 10 attempts) the ...
AldaFalda's user avatar
0 votes
1 answer
319 views

I’m trying to send a multipart/form-data request to a minimal API using the Kiota-generated HTTP client. Full scenario here. When I try to call the post function generated by Kiota, I receive the ...
tgo's user avatar
  • 15
1 vote
0 answers
104 views

I am using Fastendpoints to build my apis. Can anyone help me achieve following 2 goals please? I have tried alot of things but failing. I know Fastendpoints uses Fluent validation but I am sharing ...
DrXSsive's user avatar
  • 185
1 vote
2 answers
558 views

We have a version checker API that we're upgrading from .NET Core 3.1 to .NET 8 minimal API. It needs to be backwards compatible, but we have run into a problem. Starting in .NET 6, the default JSON ...
Walter Williams's user avatar
0 votes
1 answer
250 views

I try to put some OpenAPI documentation on a query parameter in a minimal API, using RouteHandlerBuilder extension methods. I haven't manage to find any examples or documentation on how this should be ...
Max's user avatar
  • 757
2 votes
1 answer
66 views

I am building a .net minimal api with a lot of settings defined via appsettings.json. But how to use this setting classes in program.cs without the compiler generating the warning: ASP0000 Calling '...
user1911091's user avatar
  • 1,442
2 votes
0 answers
107 views

I am using refitter to generate the type safe api. But refitter generates all the DTOs by itself, but I wannt to use an already exsisting nuget package. I tried with : refitter swagger.json --skip-...
user1911091's user avatar
  • 1,442
1 vote
0 answers
454 views

I'm looking for a solution to generate new API endpoints at runtime using ASP.NET Core 8. I'm open to generating controllers classes on the fly, using Minimal API or whatever other solution there is ...
jeanluc162's user avatar
0 votes
0 answers
183 views

I have an ASP.NET Core Minimal API with cookie authentication and I need to add some query parameters to login url when redirecting user to login page, so I can show user some hint on the login page. ...
Marmellad's user avatar
  • 356
2 votes
1 answer
281 views

I have an ASP.NET Core Blazor web app, which uses Identity for authentication. The server project's Program.cs contains the following (rather trivial) endpoint... app.MapGet("/testapi-time", ...
Avrohom Yisroel's user avatar
1 vote
2 answers
346 views

Assume I'm using the following C# Minimal API endpoint: private Calculator calcObj = new Calculator (); app.MapGet("/calc", (int a, int b) => { var additionResult = calcObj.Addition(...
user1911091's user avatar
  • 1,442
1 vote
1 answer
141 views

I have a C# .NET 8 Minimal API application, which has one service using a HttpClient to communicate with a different API. The point is one request to my application triggers thousands of requests to ...
user1911091's user avatar
  • 1,442
1 vote
1 answer
322 views

As the title says, I set up a minimal WEB API in .NET 8 with CORS, and the routes seem to be working fine on the backend, and even tested the CRUD operations with the REST Client extension in VSCode. ...
Jibril's user avatar
  • 21
0 votes
1 answer
49 views

I'm trying to upload documents via IFormFileCollection as part of a larger form submission (in a single request). Each document has additional metadata, such as document type, document name, and ...
nop's user avatar
  • 6,617
3 votes
1 answer
168 views

In order to generate a complete swagger.json file, I specify all possible return statuses for my minimal .NET API methods, which look like this: app.MapGet(rootPattern, async (MyDbContext db) => { ...
Berend's user avatar
  • 1,127
1 vote
2 answers
956 views

In our app we need to get list of all FastEndpoints endpoints at runtime. Basically we need the following info for all endpoints; GroupName (null if not belongs to any group) EndpointName (Name of ...
Onur Buyukcaglar's user avatar
0 votes
0 answers
70 views

Create the cert using Powershell New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName "localhost" -FriendlyName "localhost" -NotAfter (Get-Date).AddYears(10) ...
s k's user avatar
  • 5,342
0 votes
1 answer
240 views

I can do it with OpenSSL, but need to deploy this self signed certificate to many PCs, so that the web browser can communicate to a localhost executable. I can't ask each and every PC to install ...
s k's user avatar
  • 5,342
0 votes
1 answer
1k views

I'm trying to return an fffff from a Minimal API. When I set up the return type, I get a weird error: the non-generic type 'IResults' cannot be used with type arguments. public static async Task<...
Pure.Krome's user avatar
  • 87.5k
1 vote
2 answers
470 views

Say I want to have 2 endpoints, /a and /b, while also utilizing the pipeline branching for both of those endpoints, for adding custom middleware for them. The following code does not work: var builder ...
nix's user avatar
  • 2,293

1
2 3 4 5
8