Introduction Entity Framework Core commands are useful and make our life a bit easy to execute a few tasks. EF Core is popular Entity Framework data access technology. Entity Framework (EF) Core is a lightweight, extensible and open source. EF Core can serve as an object-relational mapper (O/RM) and it supports many database engines. I […]
Browsing Category: ASP.NET Core
How to solve Http Error 500.19 – Internal Server Error in windows server IIS for Dotnet Core application
Many of us have seen this common error Http Error 500.19 – Internal Server Error in windows server IIS. In this post, I will walk you through various steps on how to troubleshoot this error for your application. According to one of the Articles in MSDN on this error, the common HResult code is 0x8007000d. […]
Implement background tasks using IHostedService and access scoped service using IServiceScopeFactory
It is easy to implement Background tasks and scheduled work using IHostedService and the BackgroundService class. Sometimes it is required certain work to be offloaded when a Web API request is processed. That work could be accessing database records and update some information on some tables based on existing data. In this post, I’m going […]
How to use TLS 1.2 in ASP.NET Core 2.0
In this short post, I will show how to use TLS 1.2 in ASP.NET Core 2.0 and the above version. Why TLS 1.2 ? Client-Server applications use the TLS protocol to communicate across a network in a way designed to prevent eavesdropping and tampering. Since applications can communicate either with or without TLS (or SSL), […]
How to remove the server header from ASP.NET Core 3.1
In this post, I will show how to remove the server header from ASP.NET Core 3.1. The fix is the same for other versions as well. Are you looking for more security features from the below list to implement in the ASP.NET Core application? content-security-policy x-content-type-options: nosniff x-download-options: noopen x-frame-options: Deny x-ua-compatible: IE=edge,chrome=1 x-xss-protection: 1; […]
How to apply various Security Feature in ASP.NET Core application
In this post, I will show How to apply various Security Feature in ASP.NET Core application. In today’s world, the attacks against internet-exposed web apps are the top cause of data breaches that is why Web application security is crucial. There is various important security measure one should implement in a website or in a web application. I […]
Working with optional body parameters in ASP.NET Core 2.2
Working with optional body parameters in ASP.NET Core 2.2 is now possible and I will show how to solve the issue in this post. Optional parameter exists in .Net for a long time. Specifying the default value used to be enough to mark them as optional. However, marking a body parameter in a Web API […]
How to upload a file with .NET CORE Web API 3.1 using IFormFile
In this post, I will show how to upload a file with .NET CORE Web API 3.1 using IFormFile. Uploading a file is a process of uploading a file from the user’s system to a hosted web application server. You may choose to store the file in the web server’s local disc or in the […]
Entity Framework Core dbcontextoptionsbuilder does not contain a definition for usesqlserver – Solved
Introduction In this post, I will show how to solve the error that shows “Entity Framework Core dbcontextoptionsbuilder does not contain a definition for UseSqlServer” with ASP.Net Core 3 and 3.1 framework. Overview We wanted to connect our ASP.NET Core application with MS SQL. To do this, we configure a connection in the startup class. […]
Implement create, read, update, and delete functionalities using Entity Framework Core
Introduction In this post, I show how to Implement CURD functionality in ASPNETCORE using Entity Framework Core. I have my existing project with bare minimum configuration setup to start and to start with this post demo, I will be using it. To follow along with me for this post, you need to know some basic […]