To use a MariaDb database in combination with a .NET Core 3.1 Web Application and support database migrations requires a specific approach. Here are a few tips:
In Visual Studio 2019, create a Web Application project and accept the default settings.
If the Microsoft.EntityFrameworkCore package is not installed by default, use the following command line in the Package Manager Console window of Visual Studio 2019 to install the latest version:
Use this database provider, because currently (June 2020) the MySql.Data.EntityFrameworkCore data provider does not support .NET Core 3.1.
See dev.mysql.com to check if support has changed in the meantime.
To install the Pomelo.EntityFrameworkCore.MySql database provider, enter the following command in the Package Manager Console window of Visual Studio 2019:
The github page is: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql
The MySqlConnector reference must be added to your Visual Studio project if you connect to a MariaDB MySQL database and want to use .NET migrations for the database. Enter the following command in the Package Manager Console window:
The github page is: https://www.nuget.org/packages/MySqlConnector/
Put the database connection string in the Appsettings.json file of your Visual Studio project. For example:
MariaDb is developed by the same developers as MySQL. This database can be installed on various operating systems. Aside from .NET Framework and .NET Core, a variety of programming languages can connect to MariaDB.
Visit the homepage to see what services Schouten offers. This includes the creation of applications (web and standalone) that use a MariaDB database among others.
.NET Core 3.1, Web Application, MariaDb database
Created: 3/7/2020 - Last Update: 1/17/2021 - Views: 1198