码迷,mamicode.com
首页 >  
搜索关键字:dbcontext    ( 400个结果
EntityFrameWork踩过的坑
1、EF同一个linq里边不支持两个或两个以上不同dbcontext的使用,必须拆解开才能使用; ef也不支持自定义集合和dbcontext属性的混合使用. 2、如果要用用统一域账号连接database,必须在IIS Application pool中设置该域账号,如下图. 3、如果dbcontex ...
分类:其他好文   时间:2016-07-08 01:25:23    阅读次数:262
Entity Framework Tutorial Basics(39):Raw SQL Query
Execute Native SQL Query You can execute native raw SQL query against the database using DBContext. You can execute the following types of queries: SQ ...
分类:数据库   时间:2016-07-07 13:03:17    阅读次数:261
Entity Framework Tutorial Basics(38):Explicit Loading
Explicit Loading with DBContext Even with lazy loading disabled, it is still possible to lazily load related entities, but it must be done with an exp ...
分类:其他好文   时间:2016-07-07 12:38:47    阅读次数:247
Entity Framework Tutorial Basics(40):Validate Entity
Validate Entity You can write custom server side validation for any entity. To accomplish this, override ValidateEntity method of DBContext as shown b ...
分类:其他好文   时间:2016-07-07 12:24:51    阅读次数:133
osharp3 整合 dbcontextscope 文章2 将dbcontext的创建收回到ioc管理
osharp3 整合 dbcontextscope 后,,dbcontextscope 对dbcontext管理的很好,做到,用到时创建,不用时销毁,下面看一个 trace 但dbcontext默认是由dbcontextscope创建的,所以,我们的ioc就不能对dbcontext建行注入 不过它留 ...
分类:数据库   时间:2016-07-05 20:42:47    阅读次数:255
EF 自动修改数据库
1.配置类 internal sealed class Configuration<TContext> : DbMigrationsConfiguration<TContext> where TContext : DbContext { public Configuration() { Automa ...
分类:数据库   时间:2016-07-05 18:44:11    阅读次数:237
osharp3使用经验:整合DbContextScope 1
osharp3的事务处理是跳过savechangeing方法来控制的,没有DbContextScope专业 DbContextScope管理dbcontext的优劣本文不讨论 整合过程: 1、在.Data.Entity/Extensions/ServiceCollectionExtensions.c ...
分类:数据库   时间:2016-06-27 17:32:22    阅读次数:204
第五章:创建DbContext
一、DbContext介绍 DbContext是Entity Framework(EF)操作数据库的上下文网关(接口)。我们对数据库的所有操作都是通过DbContext完成的。下面我们将讨论在code first模式下如何创建自己的DbContext并配置优化。 二、创建DbContext 代码如下 ...
分类:数据库   时间:2016-06-22 01:42:04    阅读次数:255
使用EF 4.1的DbContext的方法大全
DbContext API为EF提供更多的工作方式:Code First,Database First和Model First。 ...
分类:数据库   时间:2016-06-20 15:48:40    阅读次数:567
Asp.net WebApi + EF 单元测试架构 DbContext一站到底
其实关于webapi和Ef service的单元测试我以前已经写过相关文章,大家可以参考: Asp.net WebAPI 单元测试 单元测试 mock EF 中DbContext 和DbSet Include 先看一下项目结构图: 这个demo非常简单,UTWebApi.Data 是纯粹的数据定义, ...
分类:数据库   时间:2016-06-14 22:21:42    阅读次数:374
400条   上一页 1 ... 21 22 23 24 25 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!