Skip to content

Conversation

@fiseni
Copy link
Collaborator

@fiseni fiseni commented Dec 22, 2021

Closes #111. This should be merged after PR #192.

This feature offers the possibility to check if an entity satisfies the conditions in a given specification. Since it's a single entity, it's being validated only against expressions/conditions specified in Where and Search, and everything else is omitted during this process. The usage is quite simple

var customer = new Customer { Name = "something" };
var spec = new CustomerByNameSpec("something");
var result = spec.IsSatisfiedBy(customer)

The implementation uses a separate infrastructure for this feature, by introducing new constructs ISpecificationValidator and IValidator (partial validator). I decided not to use the in-memory evaluators, since we'll force omitted evaluators to implement IsValid(), which is not nice.

@fiseni fiseni requested a review from ardalis December 22, 2021 12:53
@ardalis
Copy link
Owner

ardalis commented Jan 12, 2022

Needs docs.

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.

Evaluate Specification for one Entity

2 participants