EF终于也有了IDbContextFactory

很久没有更新blog了,最近都在忙些私人的事儿,肚子里没货当然就没得写。

今天这篇也不是什么心的技术心得,其实就是一个新闻:EF 4.1 Update 1 Released

摘抄部分内容如下

 

TitleIntroduction of new types to facilitate design-time tools for Code First. Update 1 introduces a set of types to make it easier for design time tools to interact with derived DbContexts:
  • DbContextInfo can be used to instantiate and interact with a derived context as well as determine information about the origin of the connection string etc..
  • IDbContextFactory<TContext> is used to let DbContextInfo know how to construct derived DbContext types that do not expose a default constructor. If your context does not expose a default constructor then an implementation if IDbContextFactory should be included in the same assembly as your derived context type.
 

 

众所周知,EF到现在还不支持二级缓存。我以前一直很纳闷,在EF的体系里啥对象的生命周期是Application级别的,能够让二级缓存挂在上面。很明显原来的DbContext的设计目标不是干这个活儿的,微软的walkthrough的做法基本都是即用即抛的。而IDbContextFactory的出现终于让二级缓存看到了希望吧:)

 

还有一个更新一点的新闻是Code First Migrations: August 2011 CTP Released

说实话我不太理解这个功能为啥会成为the most consistent request,反正我不觉得这功能有啥用= =

 

其实以上两则都是前两天的旧闻啦,我也是外出一周回来后刚看到。可是看似园子里没人提及这个事儿啊?估计园子里没啥人关心EF这东西啦~~~其实要不是工作需要我也懒得学这玩意,直到现在我都觉得EF真是弱爆了。。。

 

[Update]Ayende Rahien写了篇blog,喷EF 4.1 Update1作为一个小版本的update竟然有break changes(而且貌似没声明?),造成custom provider都用不了了。

posted @ 2011-08-01 00:25  jiaxingseng  阅读(2985)  评论(1编辑  收藏  举报