实体框架规范模式实现 [英] Entity Framework Specification Pattern Implementation

查看:100
本文介绍了实体框架规范模式实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何到与实体框架实施规范模式?


解决方案

  1. 规格模式:结果
    对于那些谁想要一个引子,访问该链接


  2. 理解为实体框架规格:结果
    这个 。这包括以下非常重要的观点。在任何一种现实世界的应用程序,你会很快要链接多个规格在一起。这被称为构成规格。您将需要获得一些注意事项的把握中的LINQ规范组成分辨率实体。你需要知道这一点,因为使用LINQ to实体是表示满意的规格标准,可取的办法。


  3. 修复不良:结果
    下载和安装的this 。它修复的LINQ到你读了一步两个实体的缺点。 解释了修正的实施细节。


  4. 实现它!结果
    你应该有足够的信息实现该模式。保持google搜索。这样做的EF不完全是简单,但非常值得的努力。 是一个非常有趣的实现。



How-to implement Specification Pattern with Entity Framework ?

解决方案

  1. Specification Pattern:
    For those who want a primer, visit this link.

  2. Understand Specification for Entity Framework:
    Read this. This covers the following very important points. In any sort of real world application you will quickly want to chain multiple specifications together. This is referred to as composing specifications. You will need to gain a grasp of some of the caveats for the resolution of specification composition within Linq to Entities. You need to know this because using Linq to Entities is the desirable approach to expressing specification satisfaction criteria.

  3. Fix the Badness:
    Download and install this. It fixes the shortcoming of Linq to Entities that you read about in step two. This explains more detail of the fix's implementation.

  4. Implement It!
    You should have enough information to implement the pattern. Keep googling. Doing this for EF is not entirely simple but well worth the effort. This is a very interesting implementation.

这篇关于实体框架规范模式实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆