ardalis / ardalis/Specification
How to use multiple specs in another
- Dominant language
- C#
- Stars
- 2.3k
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I try to use multiple specs in another, to create a complex spec. Is it possible ?
Thanks :)
``` C#
public class DuplicateExpenseSpecification : Specification
{
public DuplicateExpenseSpecification(Expense expense)
{
ISpecification expenseWithAmountSpecification = new ExpenseWithAmountSpecification(expense.Amount);
ISpecification expenseWithCurrencySpecification = new ExpenseWithCurrencySpecification(expense.Currency);
ISpecification expenseWithUserIdSpecification = new ExpenseWithUserIdSpecification(expense.UserId);
// this.Query...
}
}
```
Contributor guide
Research direction
Start by reviewing the Specification and ISpecification types shown in the example, then inspect how existing specifications are composed in the repository. Clarify whether the desired result is supported composition or documentation of an existing pattern; done should include a documented or tested answer for combining the three Expense specifications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100