Let's set up our development environment and build a RESTful API using ASP.NET Core MVC with Entity Framework Core and xUnit to write automated tests.
To set up the development environment we will follow a few steps. I'm using the Ubuntu system but you can follow the same sequence in Windows.
To install the .NET Core SDK on Ubuntu you can refer to the post I wrote to do this with a few command lines. But I also suggest you to read the Microsoft instructions for Linux on the download page.
If you are using windows you can download the installer and follow the instructions during installation.
VS Code is a lightweight code editor free and open source. A great tool! But there is other options like Visual Studio and MonoDevelop.
If you want to use VS Code (like me) just download and install it. Then, open the VS Code, click on
Extensions tab and install these two extensions: C# and C# Extensions (use the search bar to find them).
To persist the application data we will use a relational database. In this guide we will use the PostgreSQL database. There are other databases like SQL Server, Oracle, My SQL and MariaDB. Also, there are non relational databases like MongoDB, Amazon DynamoDB and Google Cloud Firestore that you can explore.
I will write about how we can install, manage and optimize PostgreSQL to the hardware configuration and as soon as I do, I will update this post. For now I will just recommend this great article by Digital Ocean: How to install and use PostgreSQL on Ubuntu 18.04.
To create and manage the project we will use the .NET Core CLI tools. The following content will be discussed as we develop our RESTful API:
Let's continue this topic in another post and see how we can create our first .NET Core project using CLI.