Skip to content

Conversation

amdavie
Copy link
Contributor

@amdavie amdavie commented Mar 31, 2023

For issue #294

Usage:

public class StoreProductNamesSpec : Specification<Store, string?>
{
  public StoreProductNamesSpec()
  {
    Query.SelectMany(s => s.Products.Select(p => p.Name));
  }
}

Concurrent usage of Select and SelectMany is prevented via a runtime evaluator exception.

We may want to rename ISpecification<T, TResult>.Selector to SelectExpression to match the newly added SelectManyExpression to be consistent (I couldn't come up with a good name other than SelectManyExpression).

Let me know how it looks - happy to make additional changes.

@fiseni
Copy link
Collaborator

fiseni commented Apr 6, 2023

Hey @amdavie

Thank you for your work.
I don't like the Selector name either, but we've defined that since the beginning, and would be a breaking change to rename it. Therefore, let's name the other one SelectorMany perhaps? Just to be consistent.

@amdavie
Copy link
Contributor Author

amdavie commented Apr 7, 2023

@fiseni no problem. SelectorMany it is.

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.

2 participants