Skip to content

Make filtering extensible #77

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

Closed
5 tasks done
jaredcnance opened this issue Mar 28, 2017 · 0 comments
Closed
5 tasks done

Make filtering extensible #77

jaredcnance opened this issue Mar 28, 2017 · 0 comments

Comments

@jaredcnance
Copy link
Contributor

jaredcnance commented Mar 28, 2017

Proposed by @jfhs:

I think, filter query params could be simple parsed to triplets like <key,value,operation> (as you have it now, but key and operation would be an arbitrary string). Then to support attribute filtering out of the box, in DefaultRepository.Filter check if filter key is a valid attribute, and operation is supported, then construct new FilterQuery and pass it to IQueryable.Filter
this way you can keep filtering code for EF
and then if user wants to have custom filters - he just have to override Repository.Filter and handle his custom filters before default.
and pass everything else to base class

Proposal

  • Rename FilterQuery to AttrFilterQuery
  • Create new FilterQuery with raw request (string) information
  • AttrFilterQuery accepts FilterQuery as a constructor parameter and the attribute mapping in QuerySet should be moved here
  • DefaultEntityRepository constructs AttrFilterQuery from FilterQuery
  • Document override procedure

Breaking Changes

  • The FilterQuery class is changing and could affect custom implementations of IEntityRepository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant