Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
810 views

I cannot get my application settings or connections from Azure Web App update my .net 6.0 minimal api. I've tried using environment variables but that only tells me there's a string value. I've also ...
Alex Houser's user avatar
3 votes
1 answer
840 views

I've created a minimal web API in .NET 7 and I am trying to extract some of the code to a separate assembly. This code is using IResult, which was introduced in .NET 7. How do I reference IResult from ...
Reyhn's user avatar
  • 1,057
7 votes
2 answers
5k views

I created the following class: public static class PingEndpoints { public static void Endpoints(this WebApplication application) { var group = application.MapGroup("ping"); ...
Hardipsinh Jadeja's user avatar
4 votes
1 answer
3k views

I'm trying to automate the implementation of the CRUD for my application. I'm using the Minimal API design, and I wrote a ICrudService<T> which can Get, Single, Add, Update and Delete the T ...
M. Ozn's user avatar
  • 1,238
2 votes
1 answer
1k views

I wish to send a file to an API client's GET request, but I'm getting an error: Body was inferred but the method does not allow inferred body parameters Here's what I've got: Dim sPath As String = &...
InteXX's user avatar
  • 6,557
2 votes
1 answer
2k views

After defining the endpoint app.MapGet($"{baseRoute}/GetProducts", GetProductsAsync) .WithName("GetProducts") .Produces<ProductResponseDto>() .WithTags(Tag); With this async ...
GerardoLisi's user avatar
0 votes
1 answer
659 views

I have a form posting to endpoint /api/vendors/add. when I submit the form it gives me the error, This page isn’t working If the problem continues, contact the site owner. HTTP ERROR 415 when I ...
eleethesontai's user avatar
0 votes
0 answers
184 views

Currently I'm using .NET 7 with Minimal API. I've created several methods in WebApplicationBuilder extension class, for Default policy set: private static void AddDefaultAuthorization(this ...
AtlasPromotion's user avatar
0 votes
1 answer
2k views

I have a minimal API in .NET 6. In this API, I call a 3rd party API which returns normal json formatted data by using this code: HttpResponseMessage response = await client.GetAsync(url); if (...
John's user avatar
  • 29
-1 votes
1 answer
951 views

I have two minimal APIs, the receiver one is simple var app = builder.Build(); app.MapGet("/testing", () => { Console.WriteLine("Received"); }); app.Run(); The calling API ...
user33276346's user avatar
  • 1,829
0 votes
1 answer
169 views

I tried using the following line builder.Services.Configure<JsonSerializerOptions>(options => options.Converters.Add(new JsonStringEnumConverter())); to configure that the enums are ...
user33276346's user avatar
  • 1,829
3 votes
2 answers
2k views

Is it possible to remove all logging from the minimal web api? I searched for it and my code currently looks like this: builder.Services.AddLogging(b => { b.ClearProviders(); }); This almost ...
Marvin's user avatar
  • 65
2 votes
1 answer
4k views

I'm using FluentValidation 11.5.1. I don't want to use: // MapPost // public static void AddUser([FromBody] UserRequest, [FromServices] IValidator<UserRequest> validator) I want it to be ...
Vadim Tomashevsky's user avatar
0 votes
0 answers
71 views

I use .NET 7 Minimal API (app.MapGet) but I can't figure out how to use Newtonsoft instead of System.Text.Json. I tried... builder.Services.AddMvc().AddNewtonsoftJson(); And also... builder....
MojoDK's user avatar
  • 4,568
1 vote
2 answers
134 views

Consider the following minimal repro example using the default ASP.NET Core template: var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); // Content-Type application/json, ...
Heinzi's user avatar
  • 173k
2 votes
1 answer
996 views

I am trying to write integration tests for my web service. I want to separate Program.cs into Startup.cs so test class can mock TestStartup.cs(or something like so). The point is swapping real ...
Hung P.T.'s user avatar
  • 141
3 votes
2 answers
2k views

Just need a clarification. I was keen on referencing ApiEndpoints in one of my projects. But when I am browsing the ardalis/CleanArchitecture repo I noted it has been using FastEndpoints ref. The ...
RSF's user avatar
  • 608
3 votes
1 answer
2k views

I created a simple endpoint filter on a C# minimal api and when I try to get the body into a string it is always blank. app.MapPost("/todo", async (Todo todo) => { await Task.Run(() =&...
Joe Anzalone's user avatar
1 vote
2 answers
3k views

Is there a way to access HttpContext from a request handler? I added a filter to my (minimal API) endpoint to validate the API key, coming from the request headers. Upon successful validation I need ...
Aweda's user avatar
  • 473
0 votes
1 answer
1k views

I'm doing (learning about) integration testing on my web api. One of my web api methods calls out to EXTERNAL web service that takes Basic authorization. So, I've intercepted my external web api call ...
Terry's user avatar
  • 2,028
2 votes
2 answers
4k views

While working on a larger Minimal API project, Results.Ok() was not returning the full object. However, switching to Results.Text() returns the full object. I've included the full listing of a simple ...
user12376065's user avatar
1 vote
2 answers
996 views

I am trying to learn to effectively use Minimal API's. How can I reduce duplicate codes, how to create base Endpoint class and do the most job there? Especially, how to use Mediatr from a static ...
Baran's user avatar
  • 404
1 vote
1 answer
519 views

I have a CDK solution with a stack etc and in the same solution i have created a ASP.NET minimal API Lambda project. When I deploy using the CDK I'm getting the ERROR: Internal Server Error When I ...
Chris Rollings's user avatar
3 votes
1 answer
1k views

I am currently getting the following error when executing a command via .NET Core 7 Minimal API: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has ...
dmeadley's user avatar
3 votes
1 answer
2k views

I've grouped my API endpoints into two tag/groups: "MCP Provider" and "Nexgen Provider". How can I apply a description to the tags themselves?
Terry's user avatar
  • 2,028
-2 votes
1 answer
150 views

I am trying to create a conceptual diagram after researching for a while, it seems like you need to use minimal API if you want to mesh it with a React frontend. Is it possible to do this with the MVC ...
createandlove's user avatar
2 votes
0 answers
842 views

I have a Blazor Server web application that uses Identity(DbContext, ApplicationUser) to login and register users. I am creating a .Net Core 7.0 Web API to handle the login and database interactions ...
KenNipper's user avatar
2 votes
1 answer
285 views

In the IEndpointFilter would like to get the route used. app.MapGet("/get/{productId:guid}", ...... public class MyFilter : IEndpointFilter { public async ValueTask<object?> ...
Kazmir's user avatar
  • 25
1 vote
2 answers
5k views

The convention in our microservices is to return the result as follows: return result.StatusCode == (int) HttpStatusCode.Created ? StatusCode(result.StatusCode, result.MessageCode) ...
Lorena Sfăt's user avatar
0 votes
1 answer
407 views

I have a minimal api project that works with a single DBContext for one SqlServer db that is in a separate EFCore project. I've added a second GFContext to the EFCore project. When I attempt to access ...
BedfordNYGuy's user avatar
2 votes
1 answer
210 views

I am currently getting a DI related error message when I try to run my minimal API app with the following classes. Any help would be greatly appreciated. Endpoint public static void DefineEndpoints(...
dmeadley's user avatar
1 vote
0 answers
122 views

When I publish both projects to a local Windows IIS, they both run smoothly, but when I publish to Windows Server 2019, I get an error No connection could be made because the target machine actively ...
Letuka's user avatar
  • 11
0 votes
1 answer
2k views

I had asked this question on Regex parsing with multiple named groups. This is the original problem that motivated that question and is an orthogonal problem. In .net 7, using the minimal apis is ...
vvg's user avatar
  • 1,233
3 votes
1 answer
1k views

I want to update a record by calling my api endpoint using the put verb but his returns error 405 method not allowed. My api endpoint: app.MapPut("/sirs/{Id}", async (int Id, SIRCContext db, ...
Sam's user avatar
  • 139
0 votes
1 answer
385 views

So the problem is that i have Blazor WebAssembly for a front-end, Making API calls through the Ocelot API Gateway but for some reason the CORS are failing but in Ocelot Gateway in Program.cs i have ...
Cream's user avatar
  • 43
0 votes
1 answer
418 views

My code is working, but I'm looking to see if I'm doing this in the 'proper' fashion. I have a Minimal API that supports file uploads but also I needed to pass required meta data along with the files,...
Terry's user avatar
  • 2,028
0 votes
1 answer
440 views

I am trying to use automapper in my new minimal api's project that i connected with cosmos db. When i try to get all of my objects i get the error: "Missing type map configuration or unsupported ...
Ptrk12's user avatar
  • 15
1 vote
1 answer
1k views

I've got a minimal API service with a MapPost: app.MapPost("/sendmessage", (RabbitMessage rm) => server.SendMessage(rm.exchange, rm.routingkey, rm.message)); app.Run(); record ...
Serve Laurijssen's user avatar
0 votes
1 answer
980 views

I have wwwroot folder organized for each subdomain as below. The application is based on .NET 7.0 and want to Use StaticFiles from different folders in webroot wwwroot -- folder1.abc.com --...
stack overflow's user avatar
2 votes
1 answer
1k views

HEAD The HTTP HEAD method requests the headers that would be returned if the HEAD request's URL was instead requested with the HTTP GET method. For example, if a URL might produce a large download,a ...
TheSloth's user avatar
1 vote
1 answer
1k views

With minimalistic API how does MapGet automatically fill parameters from querystring? With minimalistic API the following is possible: var builder = WebApplication.CreateBuilder(args); var app = ...
Sudip Shrestha's user avatar
0 votes
1 answer
60 views

I'm trying to create API working by minimalApi service who can be accessible from public and can send GET/POST/PUT request to my Web Service with Controllers. But every time when I Send GET to my ...
Igor Markiv's user avatar
1 vote
2 answers
961 views

I'm creating web api using .net core7 minimal api. I create a function to call stored procedure which get from table in database. I'm facing a problem to pass the sp parameter into the function. ...
Morris Law's user avatar
0 votes
2 answers
2k views

I'm using .NET Core 7, Minimal API and I would like to log POST request body. I use following code: var endpoints = app.MapGroup("api/v1") .AddEndpointFilter<...
Pavel's user avatar
  • 823
0 votes
1 answer
76 views

This would be interesting: app.UseWhenElse( context => context.condition(), applicationBuilder => { /* Condition is true */ }, applicationBuilder => { /* Condition is false */ } ...
Wim ten Brink's user avatar
2 votes
1 answer
4k views

So I'm running a Linux VM (DigitalOcean Droplet) to host my ASP.NET Core Minimal API, I've got one endpoint that requires a refresh token to be supplied in the header and have done so using the ...
Sam Marshall's user avatar
3 votes
1 answer
2k views

I am using 'OpenTelemetry.Contrib.Preview' package to attach ILogger standalone logs as Activity Events (aka Trace events) to co-relate the logs with trace & show at a single place like Jaeger. As ...
SanjayD's user avatar
  • 166
0 votes
1 answer
394 views

This is a bit tricky. I have a Minimal Web API with this function: app .MapGet("/Speak/{name}/{*text}", (HttpContext context, string name, string text) => { string mp3Name ...
Wim ten Brink's user avatar
1 vote
1 answer
381 views

I have this code: app.UseWhen(context => context.User.Identity?.IsAuthenticated ?? false, applicationBuilder => { app .MapGet("/User", (HttpContext context) => Json(...
Wim ten Brink's user avatar
0 votes
1 answer
424 views

I am working on a simple Web API that uses MySQL as database. It's pretty basic: var builder = WebApplication.CreateBuilder(args); builder .Services .AddDbContext<RequestContext>(options ...
Wim ten Brink's user avatar

1
4
5
6 7 8