Category "asp.net-web-api"

How to achieve strictly file size limit in Abp

I'm trying to set strictly file size limit using filter, in the mean while, there is already a default global setting at Startup.cs Startup.cs int sizeLimit = 2

how to Check Client connection status in Blazor web assembly

I have a Blazor webasemmbly app, it's using asp.net core as backend and Blazor wasm as frontend. I have a class that can check the HTTP issues like notfound, Ba

Error trying modify some attributes of a database table in a controller C#

I´m trying to modify attributes using sql database and web api .Net 6 In a controller i have this method private void SetRefreshToken(RefreshToken newRefr

WebAPI and Azure AD - works fine with obsolete setup, but not when updated to new setup

I have an existing Web API project, which uses Azure AD for authentication. Prior to my joining the organisation, I understand that this was an ASP.Net 3.1 proj

EF core Invalid column name after reverse engineering database using EF Power Tools

I have an API using ASP.NET Core 6 & EF6 and I reverse engineered my database (SQL Server) using the EF Core Powers Tool extension. When I try to insert a P

connect to a server with a self-signed certificate

Ive been doing some research about how to consume a web api executed on my localhost throught a xamarin app. The web api works perfect, I can adding and getting

Warning ASP5001 'MvcCoreMvcBuilderExtensions.SetCompatibilityVersion(IMvcBuilder, CompatibilityVersion)' is obsolete

In my ASP.NET Core-6 Web API, I installed this NuGet package: <PackageReference Include="microsoft.aspnetcore.mvc.versioning.apiexplorer" Version="5.0.0" /&g

Accepting body with generic type

I'm creating a web API that accepts a custom object. This works when someone does a POST request in JSON format. But now I have someone asking if they can post

Fetch Products from database with category and subcategory attached

I am building a web api and want to fetch all the products from product table I have in my database and I also want to include the category and subcategory whic

AddScheme options not loading from appsettings

I have this line in program.cs builder.Services.AddAuthentication() .AddScheme<SharedSecretAuthenticationOptions, SharedSecretAuthenticationHandler>(S

Get data from a table after having closed the session

In this moment I´m try to get a List of users and checks if the user is in the BD or not I´m using Web API Net 6 and Sql Server This is the code

how to send/create status code as response for Unauthorized requests in .Net Framework 4.0

I am using .NET framework 4.0 with WEB API 1.0. I am trying to send an HTTP 401 Unauthorized response for an unauthorized API request, but every time I receive

Blank page with no error after i scaffolded Identity

After i scaffolded identity when i run my project it gives me a blank page and the project doesn't have any errors, manually going to a page doesn't work either

how to send array to API which contains image and other data in .net core

When I am passing a single object like below then it is working as per below image [HttpPost] public async Task<ActionResult> Post([FromForm] MyModel Deta

C# REST API File Upload from Client Code gets 400 Bad Request

I have a Rest API written in .Net core that accepts a File as input as Multipart/Form-data. The API works absolutely fine when I run it from Swagger/Postman. He

how do read and write 15G txt file with 50 million record in asp core 6?

I want to read a 50milion record from 15G txt file and write in to elastic search if (file.Length > 0) { string wwroot = _he.WebRootPath;

When refreshing a page developed by nextjs error occurred

I have developed a project by nexjs which their backed is IIS and all these are working properly. I have an URL address like this : dastshafa.ir/product/2/

OpenIdDict - WebApi endpoint protection

I am trying to implement WebApi protected by access_token issued by an OpenIdDict auth server. Some APIs don't require authentication, while others do. The form

Conversion failed when converting the nvarchar value to data type int sql server

I have a table. There is data in this table and there is a checkbox next to each data. Multiple selection is possible. After the user makes a selection, the id

Implementing Azure Event Grid event handler in a Web API which subscribes to changes in Azure App Configuration

I am exploring various methods to get configuration data from Azure App Configuration and got most methods working however I am struggling to implement the Azur