问题
I'm developing an ASP.NET Core razor pages website since I'm a beginner. I'm trying to connect my web application with MySql database. Since I'm a beginner I don't really know how to connect my application with MySql database. I know how to connect with SQL Server, but I want to know about connecting to MySql.
A complete working process with MySql and Asp.Net core 2.2 Razor pages would be much appreciated.
回答1:
I suggest you take a look at Setup Entity Framework Core for MySQL in ASP.NET Core 2, as it covers the basics on how to use MySQL with ASP.Net Core 2.
Just make sure you also take a look at MySql.Data.EntityFrameworkCore, Oracle's official package for .Net Core, instead of using Pomelo's (used it in the past, but if there's an official one, it worth a check).
Hope it helps!
来源:https://stackoverflow.com/questions/53901397/how-to-connect-asp-net-core-2-2-razor-pages-with-mysql-database