Query abstraction #11513
Unanswered
puschie286
asked this question in
Show and tell
Query abstraction
#11513
Replies: 1 comment 1 reply
-
How about specification pattern: https://docs.abp.io/en/abp/latest/Specifications |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
we encounter some problem while abstracting parts of queries. some systems use the same 'base' query and put a few coditions on top of that. after a lot of different approches ( which mostly failed because of linq to sql translation problems ) we found LinqKit and were able to abstract just the specific parts of the query and combine multiple expressions to create the final query with ease.
As example: imagine you have a multiple entites with a date range and each entity define some specific data.
Now you want to write a base domain service that add the date range check to the specific entity query.
BaseDomainService:
Note: 'Start' and 'End' describe the validity of the data and 'date' is the requested DateTime the data should be valid for
( You need to add LinqKit.Core to your Domain project for this )
Im new to the usage of expression with linq to sql, so i guess its possible to do this without LinqKit but it makes the usage pretty clean and straight forward.
Hope this helps some of you :)
Beta Was this translation helpful? Give feedback.
All reactions