Skip to content

Conversation

@fiseni
Copy link
Collaborator

@fiseni fiseni commented Feb 27, 2025

Fixes #419
Fixes #420

@fiseni fiseni requested a review from ardalis February 27, 2025 13:33
this ISpecificationBuilder<T> builder,
bool condition) where T : class
{
if (condition)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of passing in a condition flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's similar to WhereIf types of LINQ extensions. In our case, if the condition is false, the statement does nothing, meaning the expression/value is not added to the specification state. This allows you to have a more succinct way of expressing the query. Instead of having if clauses, you can pass that condition to the extension method itself. We have this for a long time.
The #420 contains more details

@fiseni fiseni merged commit c0485f8 into main Feb 27, 2025
1 check passed
@fiseni fiseni deleted the fiseni/builder-infrastructure branch February 27, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IsChainDiscarded thread-static field. Improve the specification builders. Select/SelectMany should be applied in the end.

3 participants