https://github.com/FoundatioFx/Foundatio.Repositories
Generic repositories
https://github.com/FoundatioFx/Foundatio.Repositories
elasticsearch foundatio genericrepository indexing repository snapshots
Last synced: about 1 year ago
JSON representation
Generic repositories
- Host: GitHub
- URL: https://github.com/FoundatioFx/Foundatio.Repositories
- Owner: FoundatioFx
- License: apache-2.0
- Created: 2016-01-27T21:18:49.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-05-01T18:48:33.000Z (about 1 year ago)
- Last Synced: 2025-05-01T19:41:20.239Z (about 1 year ago)
- Topics: elasticsearch, foundatio, genericrepository, indexing, repository, snapshots
- Language: C#
- Size: 3.19 MB
- Stars: 81
- Watchers: 10
- Forks: 25
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://github.com/FoundatioFx/Foundatio.Repositories/actions)
[](https://www.nuget.org/packages/Foundatio.Repositories/)
[](https://f.feedz.io/foundatio/foundatio/packages/Foundatio.Repositories/latest/download)
[](https://discord.gg/6HxgFCx)
Generic repository contract and implementations. Currently only implemented for Elasticsearch, but there are plans for other implementations.
# Features
- Simple document repository pattern
- CRUD operations: Add, Save, Remove, Get
- Supports patch operations
- JSON patch
- Partial document patch
- Painless script patch (Elasticsearch)
- Can be applied in bulk using queries
- Async events that can be wired up and listened to outside of the repos
- Caching (real-time invalidated before save and stored in distributed cache)
- Message bus support (enables real-time apps sends messages like doc updated up to the client so they know to update the UI)
- Searchable that works with Foundatio.Parsers lib for dynamic querying, filtering, sorting and aggregations
- Document validation
- Document versioning
- Soft deletes
- Auto document created and updated dates
- Document migrations
- Elasticsearch implementation
- Plan to add additional implementations (Postgres with Marten would be a good fit)
- Elasticsearch index configuration allows simpler and more organized configuration
- Schema versioning
- Parent child queries
- Daily and monthly index strategies
- Supports different consistency models (immediate, wait or eventual)
- Can be configured at the index type or individual query level
- Query builders used to make common ways of querying data easier and more portable between repo implementations
- Can still use raw Elasticsearch queries
- Field includes and excludes to make the response size smaller
- Field conditions query builder
- Paging including snapshot paging support
- Dynamic field resolution for using friendly names of dynamically generated fields
- Jobs for index maintenance, snapshots, reindex
- Strongly typed field access (using lambda expressions) to enable refactoring