Category "asp.net-core"

AspNetCoreRateLimit endpoint wild-card does not work

I am trying to implement a rate limit using the AspNetCoreRateLimit package. I would like to limit the rate on only one endpoint This one: https://[removed for

ASP.Net Core API response takes too much time

I have a SQL database table with 9000 rows and 97 columns. Its primary key has 2 columns: Color and Name. You can see the simplified table to image better:

Asp.Net Core Swagger Sort Tags Alphabetically

I'm using asp.net core 6 & Swashbuckle.AspNetCore and I'm using SwaggerAnnotations in my actions But my Tags Groups are not ordered Here's my Swagger UI pag

Autofac Dependency Resolution Exception with .Net Core

I am trying to hit an endpoint in the WebAPI which is developed using .Net core. I am getting the below error -> ERROR: API exception occurred Autofac.Core.D

Authorizing based on request headers in ASP.NET Core

I have an application behind an SAML Service Provider. That means, the SP does authentication for me and I get user data in HTTP request headers (like SP_USER_N

How to restart manually a BackgroundService in ASP.net core

I create the BackgroundService: public class CustomService : BackgroundService { protected override async Task ExecuteAsync(CancellationToken cancellationTo

Private class method or interface? [closed]

I'm working on an app which uses the Factory pattern to create new objects. In the Factory Class I've added a new Private method called SendAp

How to use anchor tag as submit button in asp.net razor pages

I have a handler method in razor page with name OnGetExpense(UsePayload payload) page.cshtml: <input type="hidden" asp-for="Filters.From" value="@Model.Filte

.NET 6 (stable) IConfiguration setup in Program.cs

This appears to be a similar problem but none of the answers are fitting for my code...: Read appsettings.json in Main Program.cs This is extremely similar but

How to implement offset based pagination for nested collection in HotChocolate GraphQL?

I've been trying to add Offset pagination for a collection inside an entity. I understood that I cannot use the [UseOffsetPaging] attribute directly. So I tried

Entity Framework. How to map class with nested Enumeration class

I am using an Enumeration class like this public class SizeUnit : Enumeration { public static SizeUnit Inch = new SizeUnit(1, nameof(Inch)); public static

How to silence Serilog in integration tests with the new minimal hosting model of .NET 6

I have a .NET 6 web API project with existing integration tests for some of the API endpoints. The project uses Serilog for logging and everything was fine so f

Is there a way to show file uploading progress bar when uploading a file from a blazor WebAssembly (WASM) to a ASP.NET Core server (blazor hosted)

As the title says, I'm looking for a way to inform users about the file upload progress of a file uploaded from the Blazor WebAssembly (WASM) client to the serv

How skip some migrations in ef core?

I had some changes in my ef context and I added new Migraions dotnet ef migrations add changed98112601 then I run the below command dotnet ef database upd

Azure api works locally but not in Azure deployment, for the endpoint which need data from Azure sql db. Endpoint with hardcoded data is fine though

i have deployed a .net core web api to Azure App service. one endpoint of API which does not have anything to get from Database works fine. [Route("api/[contro

Cannot find reference assembly 'System.Reflection.Primitives.dll' file for package System.Reflection.Primitives

We have hosted a ASP.NET Core v3.1 Website in IIS. But when I try to view the page getting internal server error. This issue only occurs in the specific machine

How to show deserialized TempData object in view?

I'm getting System.NullReferenceException: 'Object reference not set to an instance of an object.' error in Index2.cshtml file after deserializing my TempData o

Guid Instead of string for primary key / ID for ASP.Net Core 3.1 Identity

This no longer works with ASP.Net Core 3.1 / .Net Core 3.1 https://stackoverflow.com/a/37173202/1698480 Compile error:'IdentityBuilder' does not contain a de

Foreign Key word display blank when the app is run

I have built a Book app in ASP.NET Core razor pages CRUD using Entity Framework. However, when I run the app and view it on https://localhost:44370/, the Foreig

ASP.Net Core Razor model validation for a <select> element

I have a .Net Core web application and I am trying to get the model validation to work as I want. The razor code is <div class="form-group"> <l