How-to implement Specification Pattern with Entity Framework ?
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With