Category "asp.net-core"

How to register Quartz.Net jobs dynamically in .Net core

I am using Quartz.Net 3.2.0 with a .net core application and here is my requirement. Users can alter the schedule from UI, they can select the report they want

ASP Core 3.1 Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals

I'm using Visual Studio 2019 and I have 5 or more areas in my ASP.NET Core MVC application. When I was about to create a new controller and new razor (.cshtml

Is there a way to execute function before unloading razor view of _Layout asp.net core

I know that I can bind handler to onbeforeunload event and execute something before full page unload. But is there a way to do this on razor view of _Layout?

How can i remotely debug an asp.net core web app deployed on an azure app service

I am working on an asp.net core web application. I need to debug this application (put a breakpoint and inspect variables when this breakpoint is hit). I can do

Error while validating the service descriptor 'ServiceType'

I interject in the method but it showing exception here: The code is extension of the services. public static IServiceCollection AddServices(this IServiceCollec

How to write an asynchronous Policy handler, injecting a scoped service

I'm trying to write a custom policy for an ASP.NET Core 3.1 web application, using a custom Identity storage provider. I've tried to wrap my head around the fa

Best practicies global result - error handling in Asp.Net core 3 and Angular 9

According to Microsoft's recommendation, throwing and catching should not be used for the normal logic of the program. Minimize exceptions As part of a ASP.Net

Does RuntimeCompilation of Razor templates on iOS work (with xamarin)?

For a project I have to know whether runtime compilation of razor templates on iOS (xamarin) devices would work. Right now I have no emulator or iOS device avai

Can't access Hangfire Dashboard using Authorization boilerplate code

I can access the Hangfire dashboard from my local environment, but can't access it from a deployed server. Initial searches showed that I needed to enable autho

Angular 12 .Net 6 value null being passed to api as "null"

I have an angular 12 UI that is communicating with a .net 6 API. When a parameter in a query string is null or undefined the API is interpreting it as a string

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