Entity Framework Specification Pattern Implementation

后端 未结 4 1297
感动是毒
感动是毒 2020-11-30 03:27

How-to implement Specification Pattern with Entity Framework ?

4条回答
  •  日久生厌
    2020-11-30 03:59

    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.

提交回复
热议问题