Category "asp.net-core"

CORS Error while calling .Net WebAPI from Axios

I have a login form from where I am calling the .Net API from react using Axios axios .post( 'https://localhost:5001/login', { email: 'abc@gmail

Process terminated. Couldn't find a valid ICU package installed on the system in Asp.Net Core 3 - ubuntu

I am trying to run a Asp.Net Core 3 application in Ubuntu 19.10 thru terminal using dotnet run command but it does not seem to work. I get this error. Process

TCP Client/Server hosted in Kestrel

I would like to create a simple TCP Server / TCP Client and use a Controller to interface with that classes, to then host the controller in a kestrel webserver

Angular and .Net Core Project VS 2022: An unhandled exception occurred: Project 'Leon\AppData\Roaming\ASP.NET\https\<projectName>.pem' does not exist

Hello I am building an Angular/.Net Core project and creating the projects by following Microsoft's suggestion, https://docs.microsoft.com/en-us/visualstudio/ja

How to create NavMenu with collapsible submenu in .Net Core Blazor app

I am trying to create a blazor navmenu which has a shape like this item a item b when I click on item b it expands with sub menu like this and clicking on subi

Can't access User Secrets in ASP.net core 3.0

My question is simple. I have an ASP.net core 3.0 app, I added secrets using visualstudio and pasted my secrets into the secret file normally. Then inside my P

how can i use Description attribute work with swashbuckle

I am using the latest version of swashbuckle for .net core and I want swashbuckle to repspect the property Description so that for all parameters the descriptio

How to include members of base entity in Swagger API Documentation?

I have something like these: BaseDTO public record BaseDTO { public virtual int Id { get; protected init; } public DateTime Timestamp {

Passing parameter to DbContext with DI

I want to pass an additional parameter to the DBContext, like this string myParam="xx"; string con="connenctionstring"; services.AddDbContext<IDbContext, DbC

Razor Pages .Net Core - cannot upload large Files / Videos

I am trying to 'upload' a video file in to my application and pass it to the database. I am able to handle pictures quite nicely however as soon as I try larger

ASP.NET Core 3.0 - Can't Update-Database

I just created the project using the command dotnet new angular -o <output_directory_name> -au Individual and scaffold identity then I installed Microsoft

Areas do not work in ASP.NET 6 with Angular project

I have created an dotnet angular project with the command: dotnet new angular -o my-new-app My app is working fine. But now I want to add areas in the controll

Difference between @bind and @bind-value

What is the difference of using @bind and @bind-value? I made this simple example, and testing it in the browser, I didn't see any difference. <p>@@bind

Using Attribute and ActionFilters for logging request and response of controller and actions

I am trying to find an elegant way of logging every request and response in my Web API using Filters in Asp.net Core 3.1 rather than have them in each action a

Update a dynamic created JS html table after a row is deleted

I have an HTML table dynamically created via JavaScript. After filling in some fields, clicking the "Add" button adds a new row to the table. After inserting a

Where is Asp.net core 3.0 nuget packages?

I went to Nuget.org to fetch Microsoft.AspNetCore.Mvc.Core 3.0.0 but didn't find it, Is there any reason for Microsoft for not pushing these packages?

Formatting DateTime in ASP.NET Core 3.0 using System.Text.Json

I am migrating a web API from .NET Core 2.2 to 3.0 and want to use the new System.Text.Json. When using Newtonsoft I was able to format DateTime using the code

Global route for all ApiControllers in .Net 6

In all of my projects i put this code in top my controllers : [Route("api/[controller]/[action]")] [ApiController] public class ValuesController : ControllerBas

Multiple Objects stored in database ASP.NET Entity Framework

Can I make the below changes to my databse whilst maintaining the one-to-many relationship? Would my Airport class need to change at all? Existing Flight class:

What is the difference between services.AddAuthentication() and services.AddAuthorization() in asp net core?

I have the following code and i want to understand what is the difference between those two extension methods. What each one do? services.AddAuthentication (Jw