9c8936,赤峰男科医院,搞笑鬼
数据库变更在编程应用中是常的,mysql、sql service之间的数据迁移更为常见,在 sqlrepoex2.0demoforaspcore 中演示了,这种数据库之间切换时sqlrepoex是如何的简单。中演示了,这种数据库之间切换时sqlrepoex是如何的简单。
第一步、增加sqlrepoex.mysql.servicecollection的nuget引用;
第二步、更改startup.cs文件中
using sqlrepoex.mssql.servicecollection;
为using sqlrepoex.mysql.servicecollection;
第三步、更改connectionstring 字串为 string connectionstring = "datasource=127.0.0.1;username=test;password=test;database=northwind;charset=gb2312;sslmode = none;";
然后,就没了
为演示代码,我在mysql中增加了`customers` 个,其结构与数据与northwind数据库customers表相同。
源码见:
https://gitee.com/azthinker/sqlrepoex2.0demoforaspcore
https://github.com/azthinker/sqlrepoex2.0demoforaspcore
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论