ardalis / ardalis/Specification

Remove Query from ISpecification interface

Open
#535 0 comments 1 reaction 1 assignee Claimed by @fiseni View on GitHub
Dominant language
C#
Stars
2.3k
Forks
262
PR merge metrics
No merged PRs in 30d

Description

Having the `Query` property exposed in the `ISpecification` interface does not make much sense. The `ISpecificationBuilder` builder and all the extensions depend on the concrete `Specification` implementation. So, if anyone has custom spec implementation, forcing them to implement the builder (which depends on our spec implementation) is nonsense. Let's remove it from the interface.

PS. The `ISpecification` is literally useless, it causes more problems than it solves, and I wish we didn't have it at all. But it's been there since version 1, and it's hard to remove it now. In my opinion, you should avoid it in your code. Just pass the concrete implementation around. You won't get any benefit just by using the interface.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.