[英]How to connect ASP.NET Core 2.2 Razor pages with MySql database?
I'm developing an ASP.NET Core razor pages website since I'm a beginner. 因为我是初学者,所以我正在开发ASP.NET Core剃刀页面网站。 I'm trying to connect my web application with MySql database.
我正在尝试将Web应用程序与MySql数据库连接。 Since I'm a beginner I don't really know how to connect my application with MySql database.
因为我是一个初学者,所以我真的不知道如何将我的应用程序与MySql数据库连接。 I know how to connect with SQL Server, but I want to know about connecting to MySql.
我知道如何与SQL Server连接,但是我想了解有关连接到MySql的信息。
A complete working process with MySql and Asp.Net core 2.2 Razor pages would be much appreciated. 十分感谢使用MySql和Asp.Net核心2.2 Razor页面的完整工作过程。
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 . 我建议您看一下ASP.NET Core 2中用于MySQL的安装实体框架核心 ,因为它涵盖了如何将MySQL与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). 只需确保您还查看了MySql.Data.EntityFrameworkCore (Oracle的.Net Core官方软件包),而不是使用Pomelo的软件包(过去使用过,但如果有官方的,则值得一试)。
Hope it helps! 希望能帮助到你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.