Category "asp.net-core"

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

Azure Cosmos DB to fetch paged results along with all records count

The document structure is like this [ { "id": "1234", "SubmittedAnswers": [ { "PlantId": 3, "UniqueQualityId": "3_pe55d74fc5f92b

When refreshing a page developed by nextjs error occurred

I have developed a project by nexjs which their backed is IIS and all these are working properly. I have an URL address like this : dastshafa.ir/product/2/

How to solve Dependency injection and Inconsistent accessibility parameter type '' in .Net 3 Worker service?

I am setting a .Net core worker services that will get some data from the database and pass that to an endpoints. So I am trying to set it up base on my .net MV

Microsoft.AspNetCore.Identity.IdentityError: "InvalidUserName"

I did default Megration with User model, added only my two custom properties. EF created standard flow of tables. And my AspNetUsers table As you can see User

What does it mean when saying "passing in something" in the following?| ASP.NET Core

I was reading a book about Learning ASP.NET Core API when I run to a part saying: We call GetCommandByID on our repository passing in the Id from our route, st

Get the very last part of a Url to use in a ternary operator

I've very new to C# and I'm using ASP.NET 6. On a .cshtml Razor page I'm trying to use a ternary operator to fill in a HTML element class based on the very las

Error: System' could not be found (are you missing a using directive or an assembly reference?) in vs 2019

I tried creating a asp.net core web application with mvc in visual code 2019 and as soon as I open it it showes me a lot of errors like in the picture. enter im

Bind Dropdownlist with TagHelpers

I am trying to create a dropdownlist and bind with viewbag using ASP.NET Core tag helpers. I can bind the dropdownlist using: @Html.DropDownList("Area_id",

ASP.NET Core CSS Isolation with Webpack

My ASP.NET Core RazorPages project uses Webpack. I also want to use CSS Isolation. Every RazorPage Foo.cshtml has an associated css file Foo.cshtml.css. These