EntityFramework.Extended MYSQL 报异常处理方法
来源:互联网 发布:京东双11数据作假 编辑:程序博客网 时间:2024/06/05 21:17
最近使用EntityFramework.Extended 操作MYSQL数据库的时候,马蛋发现都有问题,网上找了好久没有找到解决方案,最后只能扩展写了一个通过SQL操作数据库的方法,但是感觉这样操作还是不完美,经过各方面收集资料,终于找到了问题的处理方法:
public class myContent : DbContext { protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.HasDefaultSchema(""); base.OnModelCreating(modelBuilder); EntityFramework.Locator.Current.Register<EntityFramework.Batch.IBatchRunner>(() => new MySqlBatchRunner()); }// ...... }
网友提供的处理方法:
public class myContent : DbContext { protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.HasDefaultSchema(""); base.OnModelCreating(modelBuilder); }// ...... }
[STAThread] static void Main() { EntityFramework.Container container = new EntityFramework.Container(); EntityFramework.Locator.RegisterDefaults(container); container.Register<EntityFramework.Batch.IBatchRunner>(() => new EntityFramework.Batch.MySqlBatchRunner()); EntityFramework.Locator.SetContainer(container); ...... }
网友回复的处理方案:
public class DbContextConfiguration : DbConfiguration { public DbContextConfiguration() { EntityFramework.Locator.Current.Register<EntityFramework.Batch.IBatchRunner>(() => new MySqlBatchRunner()); } }
0 0
- EntityFramework.Extended MYSQL 报异常处理方法
- 如何使用Entityframework.Extended
- MySQL定义异常和异常处理方法
- MySQL定义异常和异常处理方法
- MySQL定义异常和异常处理方法
- MySQL定义异常和异常处理方法
- MySQL定义异常和异常处理方法
- MySQL定义异常和异常处理方法
- ios报异常处理基本方法
- mysql entityframework
- EF批量操作数据之EntityFramework.Extended
- MYSQL 存储过程异常处理 报错 错误代码: 1337
- java 解析xml是报编码异常处理方法
- 程序报FIPS验证加密算法异常时的处理方法
- EntityFramework 启用迁移 Enable-Migrations 报异常 "No context type was found in the assembly"
- EntityFramework错误处理
- VS2012+EntityFramework 6+mysql
- EntityFramework链接MySql数据库
- centos7.0+下安装adobe flash-player
- JS监控手机或APP返回事件
- 周赛
- Android资源之Drawable介绍(一)
- swift学习之set和get方法
- EntityFramework.Extended MYSQL 报异常处理方法
- Hibernate面试题
- 从零开始box2d(1) 创建世界
- leetcodeOJ 39
- 后渗透攻防的信息收集 -- MottoIN
- 添加小计合计的数据行
- /mnt/hgfs为空
- 缓存雪崩和缓存穿透和缓存失效
- ajax from 回调函数 data 为空