Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #344
The sample projects we had were outdated and overwhelming. Removed all of them. I created brand new sample apps, which are simple and easy to follow. Now that we have top-level statements, I added everything in a single file, so the consumers can clearly see the usage. Also, as library authors, we shouldn't have an opinion on how the users organize their solutions. That's one of the reasons I kept everything as simple as possible. There are 3 projects added:
Sample.Domain
- it's a common class library containing a few entities and specifications, so we can reuse them from the apps. Also, added a few specification extensions as an example.Sample.App1
- everything is included inProgram.cs
. This app demonstrates the basic usage of specifications. It uses the built-in repositories.Sample.App2
- It doesn't use the built-in repositories, there are custom implementations instead. I wanted to demonstrate how users can combine a few concepts and simplify overall usage greatly. These custom repositories contain methods for projecting directly to the API response models (conveniently available only forIReadRepository
). The responses are automatically paginated and wrapped inPagedResponse
. Also added examples of how to add custom evaluators. Btw, I use these repository implementations in my projects.I think these samples cover most of the scenarios that are commonly used. But, in the future, whenever we want to demonstrate something additional, we may just add another project (e.g.
App3
) and focus on that given feature.