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

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

问题描述

如何使用实体框架实现规范模式?

How-to implement Specification Pattern with Entity Framework ?

推荐答案


  1. 规格模式:

    对于想要底稿的用户,请访问此 链接

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

实体框架:

阅读 。这包括以下非常重要的一点。在任何一种现实世界的应用程序中,您都将很快地将多个规范链接在一起。这被称为组合规格。您将需要掌握一些在Linq to Entities中解决规范组成的注意事项。您需要知道这一点,因为使用Linq to Entities是表达规范满意度标准的理想方法。

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.

修正错误:

下载并安装。它将Linq的缺点修复到您在第二步中阅读的实体。 这个 解释了修复程序实施的更多细节。

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.

实施!

您应该有足够的信息来实现该模式。保持谷歌搜索为EF做这个并不完全简单,但值得付出努力。 是一个非常有趣的实现。

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天全站免登陆