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

The problem is that I can't write a request to send an array of files to endpoint. About the server-side: the project server is built on ASP.NET Core (Minimal API). Endpoint: public static ...
Cyril's user avatar
  • 1
0 votes
1 answer
320 views

I have created new project with Auto Render Mode using .net 8. There I have added an End point in the server project like bellow: public static void RegisterUserEndpoints(this WebApplication app) {...
Robin Khan's user avatar
1 vote
0 answers
638 views

I have a simple backend app. I have and endpoint called /notes for fetching notes. I have added RequireAuthorization() to it but I can't authorize the users. I have written the login and signup ...
Omid.N's user avatar
  • 873
3 votes
2 answers
514 views

So this is my setup: .NET Minimal APIs running in a Docker Container Keycloak running in a Docker Container In the development environment of my minimal-Api I can make a Http Request against the ...
Trixtor's user avatar
  • 33
1 vote
0 answers
313 views

Due to vulnerability warning in most 6.x versions of System.IdentityModel.Tokens.Jwt, I upgraded to the first non-vulnerable release 6.34.0. Problem is, I receive bearer error="invalid_token"...
VZajac's user avatar
  • 11
2 votes
1 answer
2k views

I'm using .NET 8 minimal API. I want to set the system.text.json.jsonserializer globally. i don't want to pass the defaultSerializerSettings each time. public static T Deserialize<T>(this ...
Vadim Tomashevsky's user avatar
0 votes
1 answer
1k views

I'm in the middle of converting an ASP.NET Core 6 API app to be a Minimal API app. Now that ASP.NET Core 8 supports [FromForm] for object binding, I decided to take the plunge, but I'm running into ...
Gup3rSuR4c's user avatar
  • 9,530
1 vote
2 answers
1k views

I have the following route mapped in a Mininal API application: app.MapGet("api/test", async Task<Results<PushStreamHttpResult, NotFound>> (bool fail) => { if (fail) ...
Loudenvier's user avatar
  • 8,904
4 votes
4 answers
2k views

I've got a use case where I want to host both an API and its frontend on the same port. I use YARP to do this. So all requests to https://localhost:5001 will by default be routed to https://localhost:...
Joel's user avatar
  • 9,038
0 votes
1 answer
129 views

The offical documentation suggests it is possible to bind the IsCompleted property of a Todo class as described below using form binding (https://learn.microsoft.com/en-us/aspnet/core/fundamentals/...
JensJ's user avatar
  • 309
1 vote
1 answer
681 views

In order to avoid using Tuple<,> and reduce the amount of types used when passing input models and optional validation errors I have included the List<ValidationFailure> from ...
JensJ's user avatar
  • 309
1 vote
1 answer
101 views

I have made a minimalized code to illustrate the problem at my github repo: https://github.com/suugbut/MiniTest/tree/main. I am learning integration test to test my minimal api. I cannot replace ...
user23207089's user avatar
12 votes
3 answers
6k views

This is my Minimal API (.NET 8): app.MapPost("check", async ([FromBody] UserClaims claims, ApplicationDbContext dbContext) => { var result = await dbContext.Users.SingleOrDefaultAsync(...
Amirhessam Pourhossein's user avatar
0 votes
0 answers
174 views

I have a .net 8 minimal API with swagger running OK in VS 2022 but when I containerize the app, I get a blank page when I try to access the swagger page. Here's how I set up swagger: Here's the ...
Nepaluz's user avatar
  • 707
0 votes
1 answer
734 views

I have here my Minimal API setup with ASP.NET Core versioning and Carter. PutMethod,PostMethod, and PatchMethod works just fine, but my GetMethod and DeleteMethod does not return the string. This is ...
Selene Igiu's user avatar
0 votes
0 answers
118 views

I have two .NET applications hosted on Azure Container Apps. Both applications are set up with the same ApplicationInsights instrumentation key, and I include the service when configuring them. When I ...
fra's user avatar
  • 4,068
1 vote
1 answer
491 views

I'm using .NET 7 and Minimal API. I would like to use NewtonsoftJson and this is the class that I'm using: public class FileNameRequest { [JsonProperty("some_name")] public int ...
Vadim Tomashevsky's user avatar
1 vote
1 answer
480 views

I am trying to write a c# MinimalApi EndpointFilter validator for ComponentModel DataAnnotations. What I have is working fine when passing in a type to validate against but I am trying to make it a ...
WillC's user avatar
  • 2,265
5 votes
2 answers
490 views

Is there any difference between: app.MapGroup("") vs app.MapGroup("/") app.MapGet("task") vs app.MapGet("/task") When I did tests, they looked no different. ...
Kumima's user avatar
  • 83
1 vote
1 answer
2k views

I am stuck at Google authentication in .NET Core Web API project. I am using Google as my external authenticator, everything is working fine except when the call comes back to my handler, an exception ...
DrXSsive's user avatar
  • 185
5 votes
1 answer
1k views

I am following an MS Tutorial that creates a minimal API in ASP.NET Core 8.0 and uses Endpoint Explorer in Visual Studio 2022 to generate an .http file to test the API endpoints. Code for the model: ...
Tikhon's user avatar
  • 1,074
0 votes
1 answer
1k views

I'm trying to dynamically build a MinimalApi in ASP.Net Core application and I'm struggling with generating a requestBody example. I tried to solved it like this: .WithOpenApi(x => { x....
GeorgeKarlinzer's user avatar
1 vote
0 answers
970 views

I've got a SQL server table with 32 items, it does not grow. Along with a basic stored procedure which selects them. select * from Codes Then there is a minimal API around the stored proc which just ...
Serve Laurijssen's user avatar
0 votes
0 answers
86 views

I try to test my application in 2 scopes Default ASP.NET Core Web API weatherforecast Default ASP.NET Core Minimal API weatherforecast The test results are amazing! ASP.NET Core Web API: scenarios:...
Ehsan Akbar's user avatar
  • 7,357
1 vote
1 answer
1k views

It seems that the MapDelete expects a single id to be passed, but my situation, I need to pass a pair of ids. I thought passing a JSON object content would work but it doesn't. Having a POST to act as ...
Zoinky's user avatar
  • 5,099
0 votes
1 answer
623 views

I'm creating a minimal Web API. I have defined two routes: app.MapGet("/reports/{id:Guid}", GetReportById); app.MapPost("/reports", CreateReport); with corresponding delegate ...
Peter Rundqvist's user avatar
2 votes
1 answer
1k views

I'm creating a minimal API using Swagger and C#. I can't really understand how i define the header parameters. Something like [SwaggerHeaderParameter("apikey", "description...")] ...
Bjorn's user avatar
  • 343
2 votes
1 answer
981 views

I need to manipulate the JSON after each .MapGet() in the same way (apply some transformations). I always thought that we can setup middleware on response pipeline as well as on request pipeline by ...
Kamil Stadryniak's user avatar
0 votes
1 answer
753 views

I'm building a simple .NET 8 (RC2) Minimal API. I have a simple endpoint that can return one of 3 status codes: 200, 201 or 404. app.MapGet("/check/{name}", async Task<IResult> (string ...
Misiu's user avatar
  • 4,969
0 votes
1 answer
629 views

I'm utilizing a Minimal API with a Service which calls a repository in .NET Core 6.0. I want to be able to pass a connection string to my repository. Here's the tree of my project: The idea is the ...
paula.em.lafon's user avatar
1 vote
2 answers
3k views

I am using .NET 6 minimal API. I have following simplified code which may return a file, HTTP 304 (not modified), or HTTP 403 (forbidden). app.MapGet("/download", (HttpContext httpContext) =...
Tony's user avatar
  • 1,967
1 vote
0 answers
830 views

I have successfully converted my web applications to start using the new WebApplication.CreateBuilder(args) method, but I am not managing to replicate this success in my tests using a custom (derived) ...
killswitch's user avatar
1 vote
1 answer
377 views

Is there a way in Asp .Net Core to call my API recursively every 30 minutes? The situation is the application and the app status payload is being passed at the same time. Some instances, the ...
Prosy A.'s user avatar
  • 2,822
1 vote
2 answers
2k views

I'm trying to implement fluent validation extension on minimal api endpoint project but I cannot manage to make it work the project is .net 7 version with <PackageReference Include="O9d....
user1765862's user avatar
  • 14.3k
1 vote
2 answers
807 views

Using [EmailAddress] in a controller-based API is sufficient to also include email validation errors (as far as I know), however doing the same in a minimal API doesn't have that feature. A colleague ...
ilserd's user avatar
  • 11
0 votes
1 answer
362 views

I have an endpoint in my .NET 8 web api that I want to use to return 1 to 1 the contents of an S3 object which is a JSON file. Using AWSSDK.S3, the request returns a response object with a stream to ...
rhyek's user avatar
  • 1,909
1 vote
1 answer
1k views

I was trying to bind data manually using BindAsync and I followed the Microsoft docs and here is the link : Microsoft docs. But it doesn't work with me. I have the following simple code var app = ...
Jawoy's user avatar
  • 53
1 vote
1 answer
3k views

I am using ASP.NET Core 7 for a project in which I am using Minimal endpoints. In the default minimal endpoint project, the endpoints are directly mapped in the program.cs class like this: app.MapGet(&...
rabner casandra's user avatar
1 vote
2 answers
1k views

I have the following minimal API code: routeBuilder.MapGet("/test", TestMethod); routeBuilder.MapPost("/test2", TestMethod2); ... public static async Task<IResult> ...
Sami Kuhmonen's user avatar
0 votes
0 answers
484 views

I am trying to setup Auth on a new minimal API. The API needs to connect out to Graph API (using GraphServiceClient) which I have working. I need to get security working for the API. I need to setup ...
Ben's user avatar
  • 83
1 vote
1 answer
3k views

I have a React TypeScript application which makes a call to a C# ASP.NET Core 7 Minimal API. The call from the React app looks like this: const resp = await Client.post('https://localhost:7196/...
CB_at_Sw's user avatar
  • 457
0 votes
1 answer
279 views

I'm writing a middleware to change status code to BadRequest when received business notification messages from my domain, but I getting the message "StatusCode cannot be set because the response ...
alexandro.lopes's user avatar
18 votes
5 answers
18k views

Edit: Code Repo here. Also I'm aware that I can simply add .DisableAntiforgery(); to my API endpoint as explained here to make it work, but I'd like to do this the proper way. I'm trying to upload a ...
Ash K's user avatar
  • 4,074
2 votes
2 answers
2k views

app.MapPost($"{root}/v1/AuthenticateUser" , async Task<Results<Ok<GetTokenForResponse>, BadRequest<ErrorModel>>> (HttpContext httpContext, IMediator mediator,...
Keith Barrows's user avatar
3 votes
1 answer
1k views

If you call an ASP .NET Core Minimal APIs endpoint without a Content-Type header, you get an empty body response with status code 415. I need to handle this error and respond with some error JSON. I ...
Christian Findlay's user avatar
1 vote
2 answers
2k views

I'm trying to get my simple ASP.NET Core 7 minimal API to automatically bind the QueryString parameters into a single POCO. Reference: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/...
Pure.Krome's user avatar
  • 87.5k
1 vote
1 answer
2k views

I am using fast-endpoints library for building a minimal API. I need to have two generic headers (name, tracking-Id) across all methods of all the resources. To implement this requirement, I have used ...
Raghavendra Reddy's user avatar
12 votes
4 answers
12k views

I have a .NET minimal API project, as described here. One of the endpoints accepts JSON in the request body, and this is deserialized automatically. The code looks something like this: app.MapPost(&...
Berend's user avatar
  • 1,127
6 votes
1 answer
4k views

I am using Minimal API in ASP.NET Core. I need to return a Razor page. Is there any way to do this? I have added builder.Services.AddRazorPages(); app.MapRazorPages(); in program.cs file. And I have ...
Shamim's user avatar
  • 703
0 votes
0 answers
40 views

Something is really weird happening on my development setup. I am developing for IOS but using react-native but something is happening which is weird. If I boot the app in my device, and try to fetch ...
thelittlemaster's user avatar

1 2
3
4 5
8