Category "asp.net-core"

Entity Framework. How to map class with nested Enumeration class

I am using an Enumeration class like this public class SizeUnit : Enumeration { public static SizeUnit Inch = new SizeUnit(1, nameof(Inch)); public static

How to silence Serilog in integration tests with the new minimal hosting model of .NET 6

I have a .NET 6 web API project with existing integration tests for some of the API endpoints. The project uses Serilog for logging and everything was fine so f

Is there a way to show file uploading progress bar when uploading a file from a blazor WebAssembly (WASM) to a ASP.NET Core server (blazor hosted)

As the title says, I'm looking for a way to inform users about the file upload progress of a file uploaded from the Blazor WebAssembly (WASM) client to the serv

How skip some migrations in ef core?

I had some changes in my ef context and I added new Migraions dotnet ef migrations add changed98112601 then I run the below command dotnet ef database upd

Azure api works locally but not in Azure deployment, for the endpoint which need data from Azure sql db. Endpoint with hardcoded data is fine though

i have deployed a .net core web api to Azure App service. one endpoint of API which does not have anything to get from Database works fine. [Route("api/[contro

Cannot find reference assembly 'System.Reflection.Primitives.dll' file for package System.Reflection.Primitives

We have hosted a ASP.NET Core v3.1 Website in IIS. But when I try to view the page getting internal server error. This issue only occurs in the specific machine

How to show deserialized TempData object in view?

I'm getting System.NullReferenceException: 'Object reference not set to an instance of an object.' error in Index2.cshtml file after deserializing my TempData o

Guid Instead of string for primary key / ID for ASP.Net Core 3.1 Identity

This no longer works with ASP.Net Core 3.1 / .Net Core 3.1 https://stackoverflow.com/a/37173202/1698480 Compile error:'IdentityBuilder' does not contain a de

Foreign Key word display blank when the app is run

I have built a Book app in ASP.NET Core razor pages CRUD using Entity Framework. However, when I run the app and view it on https://localhost:44370/, the Foreig

ASP.Net Core Razor model validation for a <select> element

I have a .Net Core web application and I am trying to get the model validation to work as I want. The razor code is <div class="form-group"> <l

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