Category "asp.net-core"

Visual Studio 2022 ASP.NET Core 6 Default application and Add folder to workspace in Chrome DevTools is not working anymore

After some update to either Visual Studio (I have the same issue in both VS2019 and VS2022) or Chrome I can no longer update the CSS in DevTools and have it ref

Display Multiple Tables In A Single View In ASP.NET Core MVC

I'm working on building a website in ASP.NET Core MVC (the latest version). I have Animals table and Categories table,looking like this: On my AdminController

How to Use Azure Managed Identity as Credential For Debugging Cosmos Database access inside of Blazer Server App?

Background: As described in bullet #4 of my other post I'm trying to follow CDennig's example bicep script to grant my blazor (server) application access to bot

Read action parameters from JSON properties

How can I get the parameters of an ASP.NET Core MVC controller action from the properties of a JSON object that was sent in the HTTP request body? If the reques

How to get Puppeteer-Sharp working on an AWS Elastic Beanstalk running Docker (.NET Core 6)?

I'm looking for an up-to-date example of how to get PuppeteerSharp running on an AWS Elastic Beanstalk instance running Docker (.NET Core 6). There are quite a

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

Automapper throwing System.Reflection.AmbiguousMatchException: Ambiguous match found

I have a piece of code that throws exception and I dont quite understand why. public async Task<List<CategoryVm>> Handle(GetCategoriesListQuery re

PostgreSql and EntityFramework Unable to create an object of type

when I am trying to use this command dotnet ef migrations add InitialCreate I am getting error like : Unable to create an object of type 'BlogDbContext'. For th

NET 5 and EF: how to use AddPooledDbContextFactory in liu of DbContext in services

I recently came across AddPooledDbContextFactory concept as part of my NET 5 self-education piece and am keen to implement it properly. However, I am not sure h

Binding section from appsettings.json to options

So I was trying to follow the Microsoft Docs, Options pattern in ASP.NET Core however for the life of me I can't seem to correctly get the "AppSettings" section

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;

Use the ValidateAntiForgeryToken attribute with JSON POST data

Some of my controller methods have the [ValidateAntiForgeryToken] attribute for the usual reasons. It's only app-internal actions, no cross-site API or similar.

Why register MysqlConnection as Service?

I'm trying to learn asp.net core 6.0, and I have a website that I'm working on. I needed a mysql connection in my website. I opened google and started searching

How can I pass a parameter to PDF rendering in ActiveReports 14?

I am implementing a .Net Core 3.1 REST API that needs to generate a PDF file for a given contract (the contract ID is known). I have adopted the following code

"Value cannot be null. (Parameter 'value') when using claims to login

Hi my login controller is bellow: [HttpPost] [Route("Login")] public IActionResult Login(LoginViewModel login) { if (!ModelState.IsValid

IdentityServer4 cannot configure certificate in code

I'm unable to use the builder methods AddDeveloperSigningCredential() or AddSigningCredential() to configure my certificate in code during app startup. If I kee

Async Method returns 404

I got the following problem. in my Controller, this method is supposed to return a JSON with the pets from the database. but is being called, the server returns

Create an expression dynamically to sort Linq to Entities ascending/descending based on a dynamically provided property name

Here is what I am trying to do. I have done a few simple expressions, but this one is a little too much for me right now. public static Expression<Func&l

submit large form data with post action return 400 error in .NET 6

I'm using .NET 6 to post a form with large form data (about 200Mb), and there is no any file. this's kind of my form in front-end: @using (Html.BeginForm(FormMe

Why folders in VS 2019 shows red cross 'X'?

My Observation: Its for empty folders or for empty folder hierarchy. If I add the folder again then cross is removed. (I have re-sharper installed, and don't k