Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework Specification Pattern Implementation

How-to implement Specification Pattern with Entity Framework ?

like image 547
Yoann. B Avatar asked Feb 28 '10 21:02

Yoann. B


2 Answers

Basically, there should be nothing special (due to EF) when implementing the specification pattern. You implement the specifications as separate classes, which work with your domain model.

You can find lots of articles or webcasts about the specification pattern, and even some which use EF, e.g. here and here.

like image 71
M4N Avatar answered Oct 14 '22 10:10

M4N


Just use NSpecifications lib (that I wrote myself). It's free. You can use it with any ORM based on IQueryable interface such as Entity Framework or Linq2Sql: https://github.com/jnicolau/NSpecifications

Or get it from Nuget:

Install-Package NSpecifications -Version 1.1.0

like image 23
jnicolau Avatar answered Oct 14 '22 09:10

jnicolau