Category "asp.net-core"

API responds locally (vs 2019) but not in local docker container

I am new to Docker and going through documentation and Pluralsight videos. I have a really simple API I am practising/learning to run as a docker container. Eve

ModelState.IsValid= False when upload image(bootstrap/Net core MVC)

I'm trying to upload an image, this is the view: @model CrearAmigoModelo @{ ViewBag.Title = "Nuevo amigo"; } <form asp-controller="Home" asp-action="Cr

Create dynamic entity from nested classes to bind Devexpress net core Data Grid

I have a data transfer object like this : public class PerformanceCostDto { public int Id { get; set; } public long WorkId { get; set; } public stri

_userManager.CreateAsync not working. No exception returned and finishes as HTTP error 500

I implemented Identity on a ASP .Net Core 5 Web Application. I already created and ran the proper database migrations. However, when I run the application and I

Entity Framework Core Delete Behavior

So I have these 3 tables where 2 of them(Post(Parent of Comment table as well) and Comment Table) is parent of Reaction Table. Post Table: public class Post {

Blazor WASM application stops responding after handling modal ok eventcallback, which performs a delete request

I implemented a delete button for a table, and when clicking the button a modal is shown to make sure the user really wants to delete that entry, but after the

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

ASP.NET Core 6 identityserver (duende) : no DefaultAuthenticateScheme found or no CookieAuthenticationScheme configured on IdentityServerOptions

So here's our setup. we have Angular web app Identity server API (ASP.NET Core 6, duende identity server) Identity server config in Program.cs: builder.Serv

Asp .Net Core Json deserialize to model

Returns Json format data to me from an api. However, the type of the "FuelType" property inside the object may be different. For example, 1 time comes as follow

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

EF Core - Unable to resolve service for type DbContext while attempting to activate ApplicationContext

I am attempting to scaffold CRUD razor pages using entity framework but the code generator throws the following error: There was an error running the selected

Hot to debug playwright-dotnet tests with Microsoft.AspNetCore.TestHost

I'm trying to run Playwright locally by using debugging from xUnit and AspNetCore.TestHost and even if when I call the API endpoints the calls are successfully

Update authentication Cookie in ASP.net CORE 3

In ASP.net CORE 3 app, I use authentication cookie without Identity. Here is the code when a user log in. string securityStamp = Guid.NewGuid().ToString(); var

How do I make a .NET Core 6 Top-Level statement template async?

I'm follwoing this guide: https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration and I don't understand how to make my application work as an asy

There is already an object named 'Id' in the database. Could not create constraint or index

im using EF core 3.1 and trying to Update-Database after adding migration, but im getting this error "There is already an object named 'Id' in the database. Cou

Keep ModelState After Redirect inside ExceptionFilterAttribute

I have a Mediatr pipeline behaviour which handles validation as a cross cutting concern, using FluentValidation it throws a ValidationException containing the v

Blazor Server App JavaScript Libraries Not working (Metronic Template)

I have Blazor Server Side app, where I have added JavaScript and CSS Libraries for Metronic Bootstrap Template. The template is fully loaded when I run the app,

ILoggerProvider with generic types

colleagues! Im trying to create app with Onion arch and several GUI. I used lib Log4net as my log provider. I created my own IMyLoger interface at application l

Razor page change image within form by setting a checkbox

On a razor form submit page I would like to change a picture when a checkbox is set, before the form is posted though not trough JavaScript, but by pure razor c

Running a method on timer for the life of Session

I use the following code segmant to authenticate my users to office365 for my organization and create a session cookie. This also allows me to start an SMTP con