Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
3k views

I created an ASP.NET Core Web API project with the default Visual Studio template, disabling the configure for https checkmark and whenever I am trying to run my application, I get this error shown ...
Yusniel Doral Hernández's user avatar
1 vote
0 answers
214 views

I am used to using Blazor server-side, where (basically) all the action happens on the server, so you don't need to expose APIs that need securing. I'm now exploring client-side Blazor (ie WASM), and ...
DreamingOfSleep's user avatar
0 votes
1 answer
197 views

I'm new to minimal api net7 .I want to log the application insights when any exception raise and read the configuration from app.settings.json in another common library. Here I'm using the concept of ...
prasanthi's user avatar
  • 616
0 votes
1 answer
1k views

I am setting up an authentication and authorization for my minimal API (.Net 7) using this tutorial: https://www.telerik.com/blogs/authorization-authentication-minimal-apis I have never done this ...
Michal Lyga's user avatar
0 votes
1 answer
44 views

The minimal API was written as below. How can I write a client (something like a proxy) to download the file and then forward the content to another WebAPI server? app.MapGet("/myapi", () =&...
s k's user avatar
  • 5,342
4 votes
1 answer
1k views

I am adding a group of minimal APIs like this: var myapi = app.MapGroup("myapi").WithTags("My API").WithOpenApi(); // and then myapi .MapGet($"/", GetAllStuff).WithName(&...
user479338's user avatar
0 votes
0 answers
459 views

I've been following the official documentation to mock the authorization service, and it seems to be working perfectly when using JWTBearer authentication, but it returns a 500 status code when I try ...
Matteo's user avatar
  • 1
1 vote
1 answer
2k views

I'm currently working with a minimal API in C# and I'm using various extension methods to configure endpoints. In my specific case, I have an endpoint defined like this: app.MapGet("/...
Hardipsinh Jadeja's user avatar
4 votes
2 answers
3k views

I'm quite new to the concept of a minimal API, but the documentation seems quite clear. You only have to use Results or TypedResults to return the response code you want. So I made a very basic try: ...
Patrice Cote's user avatar
  • 3,716
0 votes
1 answer
796 views

I'm new to web development generally but I'm creating a file repository that uses minimal APIs. I need to store customer files in silos so need to pass a TenantID in to choose the storage location. It ...
MisterA's user avatar
  • 93
1 vote
2 answers
607 views

I am using ASP.NET Core Minimal APIs with .NET 8. I have an application that adds some endpoints. One of these endpoints is not valid, but the app starts normaly: info: Microsoft.Hosting.Lifetime[14] ...
mMilk's user avatar
  • 255
3 votes
1 answer
1k views

I´m creating an API in .NET using Carter. I have this Module Defined: public class VariationsModule : EntityModule<Variation> { public VariationsModule() { ...
Jaime's user avatar
  • 153
0 votes
2 answers
860 views

I'm developing a document repository using a .net core api project targeted for .net 7 and with minimal API. As a stopgap the uploaded files will be persisted as files to locally attached server ...
MisterA's user avatar
  • 93
-1 votes
2 answers
415 views

I have 6 API methods as you can see: app.MapGet("/api/customer-money/", ([FromServices] IMediator mediator, string customerIsin) => mediator.Send(new GetMoneyQuery(customerIsin))); ...
Ehsan Akbar's user avatar
  • 7,357
2 votes
2 answers
869 views

AddEndpointFilter throws exception shown below in .NET 7 (7.0.102) at program start under debug. Used IDE Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.6.3 System....
beda's user avatar
  • 41
1 vote
1 answer
102 views

I have a Route Group for several endpoints: internal class EmployeeRouteGroup : RouteGroup { /// <inheritdoc /> protected override string Prefix => "employees"; /// <...
Atlass-'s user avatar
  • 125
15 votes
1 answer
13k views

I'm working with .NET minimal APIs and have encountered a problem with JSON serialization/deserialization behavior for enums. Despite my attempts to change the behavior to use strings instead of ...
nop's user avatar
  • 6,617
5 votes
1 answer
3k views

In my ASP.NET Core app I was registering an IExceptionFilter to globally catch exceptions and replace the Result returned to the client. I'm now switching to the minimal API way of doing things, but I'...
Gargoyle's user avatar
  • 10.5k
0 votes
2 answers
6k views

i have a minimal api application and i would like to return a path to file, most of the answers i found are for controller based APIs that use the Request to get the url from.
user avatar
0 votes
1 answer
268 views

I am making a very simple minimal api image uploader, and i cannot for the life of me figure out why the image will not show post upload. It launches properly, allows me to upload the image, saves the ...
Curtis Antisdel's user avatar
3 votes
2 answers
4k views

I'm trying to use minimal API in my project. the problem I'm facing is that the traditional Controllers are in a way that swagger generates a seperate section for each and every Controller. but I can'...
SinaMN75's user avatar
  • 7,847
0 votes
0 answers
336 views

I am attempting to use minimal api to develop an image uploader. I have the program.cs file code debugged and it launches to a webpage with an http 404 error. This is the entirety of the code. using ...
Curtis Antisdel's user avatar
2 votes
1 answer
124 views

I am trying to build an image uploader in a .NET 6 Minimal API. I believe that i have all the proper components but I am utterly confused on the problem that I am having. One specific line in the code ...
Curtis Antisdel's user avatar
0 votes
1 answer
2k views

The following method defines my endpoints and worked fine in .Net 6. I am upgrading this app now to .Net 8 before I get to far along since that will be standard in a few months. public static void ...
dinotom's user avatar
  • 5,182
1 vote
1 answer
728 views

Writing the Implementation Let's pretend I have a Person object: public class Person { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; ...
nathano's user avatar
  • 43
1 vote
0 answers
2k views

Building a test app with .NET 7 minimal api swagger for learning purposes. Mostly a default project at this point. What has me confused is if I convert what you see below to not be async then Swagger ...
FrankTheDank's user avatar
1 vote
1 answer
1k views

I found this in .NET 8 (prerelease) but I can't use it due to company policy. https://learn.microsoft.com/en-us/aspnet/core/performance/timeouts?view=aspnetcore-8.0&viewFallbackFrom=aspnetcore-7.0 ...
s k's user avatar
  • 5,342
8 votes
2 answers
21k views

I'm writing some middleware for an ASP.NET Core 7 minimal API project. At this stage, I would just like to be able to read the request body being sent in, and then the response body that is being sent ...
Avrohom Yisroel's user avatar
3 votes
2 answers
2k views

I'm working on a minimal API in .NET Core 6 with OpenApi support. I have a Resolution model defined like this: using System.ComponentModel.DataAnnotations; public struct Resolution { [Required, ...
Fuczak's user avatar
  • 350
0 votes
1 answer
123 views

How do I modify my exception middleware to still continue execution of this code below: public async Task<MessageResponseModel> TransferSecondModelData() { //get the untransferred records ...
Prosy A.'s user avatar
  • 2,822
1 vote
1 answer
124 views

I have this model: namespace SomeApp.Models { public class FirstModel { public int uid { get; set; } public string? id { get; set; } public string? firstname { get; set;...
Prosy A.'s user avatar
  • 2,822
5 votes
1 answer
9k views

I would like to add examples of answers for my endpoints in my minimal API in .NET 7. I have already found several interesting resources but none of them work in the context of a minimal API: https://...
heexos's user avatar
  • 73
0 votes
0 answers
153 views

I was reading whole topics on StackOverflow and NLog's wiki but nothing works for me.. Maybe I am unable to see something and someone could see it. I have a minimal API and I would like to log my ...
frozzen10's user avatar
  • 171
0 votes
1 answer
2k views

I am having an issue with authenticating my webapi(.net core 7 minimal api) requests:I can successfully generate a token but when I pass it over to another endpoint that requires authentication I get ...
Jack M's user avatar
  • 2,584
-1 votes
1 answer
898 views

Why is the .NET 7 minimal api throwing a run time error for the following POST endpoint? Required parameter "Guid fooId" was not provided from query string. It is trying to model bind to a ...
Learning AWS and PostgreSQL's user avatar
0 votes
1 answer
918 views

I have quite a few places where multidimensional arrays of varying lengths are used as query parameters. With controllers a request with to /multi?vals[0][0]=5&vals[0][1]=6&vals[1][0]=6&...
bep's user avatar
  • 752
0 votes
1 answer
899 views

I'm trying to return a Tuple in a minimal API, it boils down to this: app.MapPost("/colorkeyrect", () => server.ColorkeyRect()); public (int x, int y, int w, int h) ColorkeyRect() { ...
Serve Laurijssen's user avatar
2 votes
1 answer
2k views

Our team maintains a huge repository containing multiple applications that have been started more than 10 years ago. The strategy at that time was to create classes that implement IHttpHandler and the ...
Tom Sawyer's user avatar
0 votes
1 answer
533 views

I'm using an ASP.NET minimal API which works fine when launching normally, but when I try to reuse the Program class from my integration tests there is one endpoint that fails in a custom middleware. ...
dakotapearl's user avatar
1 vote
2 answers
4k views

I would like to test the routing of a minimal API WebApplication. How can I get the route name, given a HttpRequestMessage? var builder = WebApplication.CreateBuilder(args); builder.Services....
Cameron Taggart's user avatar
2 votes
1 answer
3k views

We have a minimal API application, and whenever we start the app, we get a "Localhost not found" error instead of getting the Swagger interface. If we add the /swagger to the end of the URL, ...
John Swaringen's user avatar
2 votes
1 answer
2k views

So I have a little problem here, I wanted to port a .NET Core 2.1 web API to an ASP.NET Core web API with .NET 7. I need to be able to upload files larger than 50MB (up to 300MB, since it will include ...
OverWorker's user avatar
3 votes
2 answers
2k views

Using an ASP.NET Core 6 Web API written in C# with minimal API, I would like to return a stream of data without first loading the data into memory. In my case this is JSONL (JSON lines) data that is ...
Morrolan's user avatar
  • 317
3 votes
1 answer
2k views

I'm using C#, .NET7 minimal API and HotChocolate GraphQl. I'm trying to setup graphQl simple query endpoint which will be able to return stream like this: public async IAsyncEnumerable<string> ...
Rafp's user avatar
  • 63
3 votes
1 answer
715 views

I am still learning and afraid of captive dependency (a dependency with an incorrectly configured lifetime). Consider the following code snippet and the full code is given at the bottom. My objectives:...
D G's user avatar
  • 890
1 vote
2 answers
291 views

I have created a minimal ASP.NET Core Web API project in Visual Studio. And then deploying this to Azure Web App Service to be able to 'GET' results remotely. Locally, the /weatherforecast sample data ...
anotherSTACKmember's user avatar
1 vote
2 answers
180 views

The following code simulates the problem. I do register the dependency but errors still occur. using Microsoft.AspNetCore.Mvc; var builder = WebApplication.CreateBuilder(args); builder.Services....
D G's user avatar
  • 890
2 votes
1 answer
849 views

I have created an Interface. public interface IEndpoint { RouteGroupBuilder MapRoutes(IEndpointRouteBuilder rotues); } And it's implementation like this. public class TodoApi : IEndpoint { ...
Nasim Uddin's user avatar
5 votes
1 answer
2k views

In minimal API I define this endpoint that accepts DateOnly parameter: app.MapGet("/info", (DateOnly date) => $"{date.ToString("yyyy-MM")}"; By default swagger json ...
joostas's user avatar
  • 591
-1 votes
1 answer
353 views

I am sending data from dot net minimal API : app.MapGet("/mytableDistinct", async ([FromServices] ShipmentDbContext dbContext) => { IQueryable<long> query = dbContext.MyTables....
Rifat's user avatar
  • 1,928

1 2 3
4
5
8