How to connect ASP.NET Core 2.2 Razor pages with MySql database?

自作多情 提交于 2020-01-06 04:31:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!