Category "asp.net-core"

Ignore global query filter for joined entities

Global query filters are very handy when implementing tenant and soft deletion features. But my problem is is that when i write a query with joins, for instance

Can't start worker service as windows service

So. I created a worker service and want to run it as windows service. It works locally. I installed it to windows server via powershell new-service command. Whe

.Net Route Action Parameter coming back null despite being in url

UPDATE: It works fine is I add another parameter. I have no idea why. Not sure what I am doing wrong, this route looks the same as the other routes, I've looked

Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: The same schemaId is already used for type "X"

The project of .net core WebApi generate the right swagger when a class is generated in one DLL. this solution works fine, the project is compiled and the swagg

How to Bind a List in Model with HTML Form in ASP.NET Core?

I'm unsure what I'm doing wrong when trying to map form values to my model, FieldMappingCollection. I've been able to get the Id and Name back for the model but

How to show a custom 404 page instead of default by Browser? When I'm using my Razor Pages Application

If you type http://google.com/ShowMeYourCustom404Page in your browser and then press Enter. You will be redirect to Google 404 Page. If we apply the same conce

Avoid unnecessary include statements in SQL database query for ASP.NET Core

There are some times where I have a user and would like to check whether they are in the organization that owns the item they are trying to access. Let's say th

Azure Web API giving a 404 when deployed but works locally

We have a .NET Core Web API deployed as an Azure Web App. All endpoint work locally, however, once deployed, we have one controller that is gives us a 404 for a

ASP.NET Core MapFallbackToFile is not handling non-existings urls. Only homepage

I am creating Blazor app. If I navigate to homepage - page loads fine, then I navigate into article e.g. localhost/new-article. Next step is page refresh via F5

How to secure ElmahCore Errprs Dashboard page on ASP.NET CORE API end

I have ASP.NET Core API that is being consumed by an Angular app. Now I have implemented ElmahCore error logging API that shows all errors of Backend API on the

ASP.NET Core 3.1 MVC JWT Login return 401

I have a problem , jwt authentication return 401 Error. Token was created but always return 401 error. I used layered architecture. I tried many things on start

DateTime from view to control to Mapper

i'm trying to pass A DateTime data type to a controller that will call a Mapper to pass it into a db. Additionally the DateTime is taken from a db at first. db

Blazor Hybrid App how to navigate to pages

How can I navigate between Razor pages in an Blazor Hybrid App? I found this explanation: https://docs.microsoft.com/en-us/aspnet/core/blazor/hybrid/routing?vie

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