8000 Refactor Include evaluator. Implement caching. · Issue #425 · ardalis/Specification · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Refactor Include evaluator. Implement caching. #425
Closed
@fiseni

Description

@fiseni

We're storing the Include expressions as LambdaExpression in the specification. We have no other choice, we can not store the sub-chains in generic form.

Then, in the evaluator, we call the EF generic methods through reflection. To optimize the reflection calls, we have a cached implementation where we create and cache proxy delegates. This improves performance significantly. Currently, this implementation is an opt-in feature.

I think we should finally make this implementation the default one. We need to clean it up a bit and make some further optimizations.

Breaking Changes:

  • The common use of this library will remain unchanged.
  • The SpecificationEvaluator no longer accepts bool cacheEnabled parameter.
  • The include string evaluation is extracted in a separate IncludeStringEvaluator construct.
  • The IncludeEvaluator.Default and IncludeEvaluator.Cached singleton instances are removed. Instead, use the IncludeEvaluator.Instance.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0