In this series, we are going to go through a detailed example of how to use .NET Core, Angular 4 and MySQL for ASP.NET Core web application development.
If someone asks: “Why this combination of technologies”, without getting in too much detail, the answer would be:
- The technologies are free of charge
- Applications can be deployed on both Windows and Linux OS
- Production-grade performance
- … And because we can 🙂
Even though this tutorial is created in .NET Core 2.0, it is completely compatible with the .NET Core 2.1 version, so feel free to use whatever version you find acceptable.
What are we going to do in this guide?
We are going to use MySQL as our database. First, we are going to install the MySQL server, create tables and populate them with some data.
Then we are going to step into the world of .NET Core Web API development. It is going to be our server-side part of the application. Even though this app is small, we are going to use repository pattern, generics, LINQ, entity framework core, create more projects and services to demonstrate some good practices. Overall we will try to write the application as we would in the real-time environment. Furthermore, you will learn about .NET Core architecture and code organization, so you can make it more readable and maintainable.
There are three approaches to using Entity Framework: Database First, Code First and Model First. In this tutorial, we are going to use the Database First approach, because we want to create our database prior to typing .NET code. This approach is good when you know the structure of your database beforehand, and we get to use the visual editor which makes the creation of relationships between tables much easier.
After the server part, we are going to introduce one of the most popular client frameworks (Angular, React or Vue.js) to consume our Web API. Thus creating a full stack web application.
In the end, we are going to publish our app on Windows and Linux OS, and finish strong by completing the whole development cycle.
List of technologies required for this part of the series:
To install MySQL on your machine, follow this guide.
You can install Visual Studio 2017 by following these instructions (In the section where you select workloads, please select ASP.NET and web development section).
- Intermediate C# knowledge
- Knowledge of the Object-Oriented Programming in the C# is a plus
This tutorial will be separated into several parts:
- Creating a database
- Basic code preparations
- Custom logging in .NET Core
- Repository pattern with Entity framework core
- Using repository for GET requests
- Using repository for POST, PUT and DELETE requests