首页 > Web开发 > 详细

.netFramework 升级NetCore 问题汇总及解决方案

时间:2019-08-28 13:35:22      阅读:508      评论:0      收藏:0      [点我收藏+]

升级版本:

NetCore sdk 2.2.108 

EFCore 2.2.6

所有程序引用均从NuGet上下载,并支持NetCore 


问题: 

问题1:No coercion operator is defined between types ‘System.Int16‘ and ‘System.Boolean‘(mysql 数据库类型转化中int16 byte bool 转化问题)

解决方案:

引用 Pomelo.EntityFreamworkCore.Mysql 2.2.0 代替 MySql.Data.EntityFrameworkCore 

问题2:Error generated for warning ‘Microsoft.EntityFrameworkCore.Database.Transaction.AmbientTransactionWarning: An ambient transaction has been detected. The current provider does not support ambient transactions.(环境事务、分布式事务问题)

解决方案:

因为Pomelo.EFCore.Mysql 2.2.0 不支持TransactionScope 

所以 采用 using (var scope = DataContextFactory.GetDataContext().Database.BeginTransaction(System.Data.IsolationLevel.RepeatableRead)) 或者 

using (var scope = new CommittableTransaction()) 这两种事务代替

问题3:

 

)

 

.netFramework 升级NetCore 问题汇总及解决方案

原文:https://www.cnblogs.com/zhaokunbokeyuan256/p/11423522.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!