Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample applications. #347

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Add sample applications. #347

merged 1 commit into from
Jul 21, 2023

Conversation

fiseni
Copy link
Collaborator

@fiseni fiseni commented Jul 21, 2023

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 in Program.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 for IReadRepository). The responses are automatically paginated and wrapped in PagedResponse. 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.

@fiseni fiseni requested a review from ardalis July 21, 2023 21:12
@ardalis ardalis merged commit 60d3239 into main Jul 21, 2023
@fiseni fiseni deleted the fiseni/sample-apps branch July 24, 2023 16:23
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.

Update Sample projects
2 participants