码迷,mamicode.com
首页 >  
搜索关键字:dbcontext    ( 400个结果
EF 多线程插入 Insert into DbContext Multithreading
当通过task 插入多条数据时报错。 DBcontext 不是线程安全的, 如果是WebAPI 为每个请求创建DbContext 部分解释: http://stackoverflow.com/questions/28106267/insert-into-dbcontext-multithreadin...
分类:数据库   时间:2015-08-11 09:56:22    阅读次数:235
EF中使用NextVal(oracle)
编写扩展方法public static decimal GetNextVal(this System.Data.Entity.DbContext ctx, string seqName) { return ctx.Database.SqlQuery(string.Format("SELECT {0}...
分类:数据库   时间:2015-08-06 09:22:27    阅读次数:239
code first使用t4模板
http://stackoverflow.com/questions/23347093/dbcontext-generator-t4-templates-with-code-firstdbfist使用t4模板edmx文件codefirst没有edmx文件,只有dbcontext类文件,稍微有点不一样...
分类:其他好文   时间:2015-08-05 17:45:18    阅读次数:343
MVC初学 - The type or namespace name 'DbContext' could not be found
问题:The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)解决方案:引用EntityFramework.dll 即...
分类:数据库   时间:2015-08-05 10:25:59    阅读次数:227
使用EF6连接MySQL
今天在项目中使用EF6连接MySQL时费了一些周折,特此做一下记录。之前在用EF4的时候,只需要使用NuGet安装好EF4,建好继承自DbContext的上下文类就可以直接使用了。但是这一次使用EF6,始终报这个错误:经网上查询得知,除了要安装mysql.data.entities外还需要在Web....
分类:数据库   时间:2015-08-04 15:29:24    阅读次数:140
xlt不懂技术。
在XltAppDataContext:DbContext总 protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Configurations.Add...
分类:其他好文   时间:2015-07-30 14:49:22    阅读次数:96
Code First04---关于上下文DbContext
这章主要讲怎么配置DbContext的子类访问的数据库的位置。我相信大家最经常使用的数据库位置的配置方式就是配置文件了,也就是通过App.Config 或Web.Config来配置要访问的数据库。我们可以再配置文件里添加一个连接字符串的配置来定义数据库的位置 那么怎么样Code First知道使用....
分类:数据库   时间:2015-07-23 19:50:11    阅读次数:381
MVC-CodeFirst(二)
MVC-CodeFirst(二)DAL层MyWebDbContext类 需要定义一个继承DbContext类的子类 1 public class MyWebDbContext : DbContext 2 { 3 //更新数据的命令: 4 //Add-...
分类:Web程序   时间:2015-07-20 18:31:05    阅读次数:140
asp.net linq查询环境搭建
要搭建这样一个数据库的操作环境,首先建立一个类库项目然后在这个类库项目中添加几个类:DBDataContext数据库上下文,继承DbContext;DBA数据库访问类,继承DBDataContext;DBAManager数据库控制类。DBDataContext:public class DBDat....
分类:Web程序   时间:2015-07-15 19:13:45    阅读次数:114
ABP Migration(数据库迁移)
今天准备说说EntityFramework 6.0+,它与我之前所学的4.0有所区别,自从4.1发布以来,code first 被许多人所钟爱,Dbcontext API也由此时而生。早在学校的时候就听老师说过Db first,Model first 和 Code first ,没怎么去注意,...
分类:数据库   时间:2015-07-14 17:21:30    阅读次数:696
400条   上一页 1 ... 29 30 31 32 33 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!