All Questions
Tagged with c# asp.net-core-webapi
4,580
questions
0
votes
0
answers
27
views
Uploading file to ASP.NET Core Web API using VBA
I'm struggling to upload a CSV file from local drive to a Web API.
Sub Upload()
Dim objHTTP As New MSXML2.ServerXMLHTTP60
Dim url As String
Dim filename, resp As String
Dim boundary, ...
0
votes
1
answer
30
views
Unable to send a local image that isn't under wwwroot to openai using its new .NET library
I have an ASP.NET Core 6 Web API with the new official library from OpenAI (https://github.com/openai/openai-dotnet).
What I'm trying to do, is to use a local image file to OpenAI. The file isn't ...
2
votes
0
answers
34
views
Can't use Entity Framework Core with Supabase (PostgresSQL)
I was trying to move my project from local to remote database.
I've created an ASP.NET Core 7 Web API project. I've installed Microsoft.EntityFrameworkCore 7.0.20, Microsoft.EntityFrameworkCore.Design ...
0
votes
1
answer
64
views
How to authenticate an ASP.NET Core Web API using Azure AD token and custom claims from ASP.NET MVC app?
I have two applications: one built with ASP.NET MVC and the other an ASP.NET Core Web API. Users log in to the ASP.NET MVC application using Azure Active Directory (Azure AD). Upon successful login, I ...
0
votes
0
answers
72
views
API controller class for all tables
I'm creating an EF Core API to connect my MAUI app to my SQL Server database.
This is my tblUser table's controller (Select, Create, Update, Delete, all the usual stuff) in the API:
UserController:
[...
0
votes
1
answer
36
views
Google OAuth 2.0 integration in ASP.NET Core Web API project in C#
I'm getting the error when trying to log in with google .
Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
---> ...
0
votes
0
answers
35
views
Deploying an ASP.NET Core 8.0 Web API
I am a newbie in ASP.NET. I have an ASP.NET Core 8.0 Web API. The application is to be published. On the production system (Windows) .NET Core Hosting Bundle is installed. An Apache server serves as a ...
0
votes
1
answer
76
views
403 from Azure only in a specific endpoint with specific version of the API
We developed a middleware service Web API app in .NET 6 with several endpoints and deployed it to Azure. We get a strange error with an endpoint that implements a POST method.
If we change the version ...
0
votes
2
answers
60
views
How to bind json data to FromBody Dto in ASP.NET Core Web API?
In my ASP.NET Core Web API, when I call a method that is a HttpPost and receives a DTO object in FromBody, and sends extra fields that are not in SourceUrlDto, I fail during binding on the code side.
...
0
votes
1
answer
67
views
API cannot see Website middleware assignments to HTTPRequest
I am trying to understand why the API cannot see what assignments I am making in the middleware of the Website.
public async Task InvokeAsync(HttpContext httpContext) { try { ...
0
votes
1
answer
46
views
How replace OneOf to AnyOf in swagger generation
I have a c# code that generates swagger
services.AddSwaggerGen(options =>
{
options.UseOneOfForPolymorphism();
options.SelectDiscriminatorNameUsing(_ => "messageType&...
1
vote
0
answers
40
views
ASP.NET Core Web API : authentication users files
I'm working on an ASP.NET Core 6 Web API project where users upload their own files, and these files are stored in folders corresponding to their IDs (GUIDs) on the same Linux server.
To serve these ...
1
vote
1
answer
54
views
CancellationToken not working in ASP.NET Core Web API HostedService
I have an ASP.NET Core 8 Web API that has a HostedService and a controller. The controller uses an interface that the HostedService also implements so that the service may be started, stopped, or ...
0
votes
0
answers
83
views
ASP.NET Core 6 Web API : JWT never refreshes in the API
The primary question is this: why can I not send the API a single string in the requests without trying to access the HttpClient or HttpRequestMessage, or have the Auth Header actually work correctly?
...
1
vote
2
answers
34
views
How to access Route parameter in Custom validator in ASP.NET Core Web API?
I have implemented a custom model validator using data annotations, where I wanted to compare two dates and validate if one is greater than the other, or not.
It works fine in POST (create) endpoint. ...