Skip to content

Implemented LINQ query optimization for ObjectListFilter #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

VectorTetra
Copy link
Contributor

No description provided.

Comment on lines +276 to +281
if options.Optimize then
let body = ExpressionOptimizer.visit(buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter)
whereExpr<'T> query param body
else
let body = buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter
whereExpr<'T> query param body
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if options.Optimize then
let body = ExpressionOptimizer.visit(buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter)
whereExpr<'T> query param body
else
let body = buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter
whereExpr<'T> query param body
if options.Optimize then
buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter
|> ExpressionOptimizer.visit
else
buildFilterExpr (SourceExpression param) buildTypeDiscriminatorCheck filter
|> whereExpr<'T> query param

||| (("firstName" @=@ "a")
||| ("lastName" @=@ "a"))))))
let queryable = data.AsQueryable ()
let filteredData = queryable.Apply (filter, ObjectListFilterLinqOptions(optimize = true)) |> Seq.toList
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let filteredData = queryable.Apply (filter, ObjectListFilterLinqOptions(optimize = true)) |> Seq.toList
let filteredData = queryable.Apply (filter, ObjectListFilterLinqOptions (optimize = true)) |> Seq.toList

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