The .NET Core is a high performance, free and open-source software framework. It is developed by Microsoft and is a very powerful framework.
In this tutorial, we will set up a .NET Core framework on Ubuntu and create an ASP.NET Core application that will contain basic CRUD functionality using Entity Framework Core.
Entity Framework is an ORM that enables .NET developers to work with a database using .NET objects and eliminates the need for more of the data-access code that developers usually need to write. Entity Framework is great but was difficult to use in mobile development projects until Entity Framework Core was released.
Entity Framework Core is a lightweight, extensible, cross-platform version of Entity Framework data access technology.
Ubuntu is a free and open-source Linux distribution based on Debian. It is officially released in three editions.
All the editions can run on the computer alone, or in a virtual machine. Ubuntu is a popular operating system for cloud computing, with support for OpenStack.
If you are using Debian, Ubuntu, Linux Mint or any other Debian or Ubuntu-based distributions, you must have come across some apt commands by now.
The apt works on a repository of available packages. If the repository is not updated, the system won’t know if there are any newer packages available. Therefore, updating the repository should be the first thing to do in any Linux system after a fresh install.
sudo apt update
When you run this command, you will see the package information is retrieved from various servers.
Once you have updated the package repository, you can now upgrade the installed packages. The most convenient way is to upgrade all the packages that have available updates. You can simply use the following command.
sudo apt upgrade
This will show you how many packages are going to be upgraded.
At this moment .NET Core 3.1 is the latest, but you can check here for the latest version https://dotnet.microsoft.com/download/dotnet-core.
In your terminal, run the following commands to install the .NET SDK.
sudo apt-get install apt-transport-https sudo apt-get install dotnet-sdk-3.1
The “apt-transport-https” APT transport allows the use of repositories accessed via the HTTP Secure protocol (HTTPS), also referred to as HTTP over TLS.
In your terminal, run the following command to install the ASP.NET Core runtime.
sudo apt-get install aspnetcore-runtime-3.1
To install the .NET Core runtime, run the following command in the terminal.
sudo apt-get install dotnet-runtime-3.1
Visual Studio Code is a free code editor from Microsoft. It combines the simplicity of a source code editor with powerful developer tooling, like IntelliSense code completion and debugging. You can download it from Visual Studio Download page.
Click on the .deb link for Linux 64 Bit. After the file downloads, open your terminal and go to the Downloads folder.
Run the following command to install the Visual Studio Code.
sudo dpkg -i code_1.42.1-1581432938_amd64.deb
The “code_1.42.1-1581432938_amd64.deb” is the downloaded file name.