You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been trying hard not to make the package too EF centric. But, we've added AsNoTracking, AsNoTrackingWithIdentityResolutionEvaluator, AsSplitQueryEvaluator. So, I assume we can add this one too, it's useful one.
I implemented this by myself. I derive from Specification and use an evaluator. The new specificaton class is a base class from that I can derive my business specifications. It was very easy for me.
But I was suprised that the SpecificationEvaluator has no ctor to add my new evaluator to the default ones. So I had to copy the whole list from the default ctor. I think no one would loose the default evaluators.
Note to implement IgnoreQueryFilters in the next release.
Regarding your question, the SpecificationEvaluator has 2 constructors, parameterless one and the one accepting a list of evaluators. There is no ctor that accepts a single evaluator (to be appended to the default ones), and that's done intentionally. The order of evaluation might be important, and we simply wouldn't know where to place your evaluator (it would be a guessing game). So, yeah you have to pass the whole list 😄 Just copy-paste stuff from the default evaluator and add yours.
Activity
fiseni commentedon Sep 20, 2021
We've been trying hard not to make the package too EF centric. But, we've added
AsNoTracking,AsNoTrackingWithIdentityResolutionEvaluator,AsSplitQueryEvaluator. So, I assume we can add this one too, it's useful one.ardalis commentedon Sep 20, 2021
Agreed. As much as possible it's nice to put them in the EF-specific packages, but I know that's not always possible, either.
Codibex commentedon Oct 15, 2021
I implemented this by myself. I derive from Specification and use an evaluator. The new specificaton class is a base class from that I can derive my business specifications. It was very easy for me.
But I was suprised that the SpecificationEvaluator has no ctor to add my new evaluator to the default ones. So I had to copy the whole list from the default ctor. I think no one would loose the default evaluators.
fiseni commentedon Dec 2, 2021
Note to implement
IgnoreQueryFiltersin the next release.Regarding your question, the
SpecificationEvaluatorhas 2 constructors, parameterless one and the one accepting a list of evaluators. There is no ctor that accepts a single evaluator (to be appended to the default ones), and that's done intentionally. The order of evaluation might be important, and we simply wouldn't know where to place your evaluator (it would be a guessing game). So, yeah you have to pass the whole list 😄 Just copy-paste stuff from the default evaluator and add yours.