Skip to content

Redefine WithProjectionOf as an extension to Specification instead of ISpecification #516

Closed

Description

@fiseni

In version 9.1.0 (a couple of months ago), we added the WithProjectionOf feature. It's still a kind of experimental feature, and we're keen to get some feedback from consumers and understand how it is being utilized.

I think we made a minor mistake on our first shot. We've defined it as an extension to ISpecification<T>. This doesn't make much sense. The feature is based on the internal mechanics we have, and won't work for any arbitrary user-defined ISpecification<T> implementation. This journey toward spec composition will be heavily based on our internals.

Based on all this, let's rectify the initial mistake and redefine it as an extension to the concrete Specification<T> type.

PS. The ISpecification<T> 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.

Activity

  1. self-assigned this
    on Jun 14, 2025
  2. added this to the 9.3.0 milestone on Jun 14, 2025
  3. Edgaras91 commented on Sep 11, 2026

    @Edgaras91

    We were hit by this when upgrading the NuGet package. Thanks for the detailed explanation; now we know how to best move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions