![]() |
VOOZH | about |
dotnet add package Foundatio.Repositories.Elasticsearch --version 7.18.3
NuGet\Install-Package Foundatio.Repositories.Elasticsearch -Version 7.18.3
<PackageReference Include="Foundatio.Repositories.Elasticsearch" Version="7.18.3" />
<PackageVersion Include="Foundatio.Repositories.Elasticsearch" Version="7.18.3" />Directory.Packages.props
<PackageReference Include="Foundatio.Repositories.Elasticsearch" />Project file
paket add Foundatio.Repositories.Elasticsearch --version 7.18.3
#r "nuget: Foundatio.Repositories.Elasticsearch, 7.18.3"
#:package Foundatio.Repositories.Elasticsearch@7.18.3
#addin nuget:?package=Foundatio.Repositories.Elasticsearch&version=7.18.3Install as a Cake Addin
#tool nuget:?package=Foundatio.Repositories.Elasticsearch&version=7.18.3Install as a Cake Tool
π Build status
π NuGet Version
π feedz.io
π Discord
A production-grade repository pattern library for .NET with Elasticsearch implementation. Built on Foundatio building blocks, it provides a clean abstraction over data access with powerful features like caching, messaging, soft deletes, and versioning.
π Full Documentation
dotnet add package Foundatio.Repositories.Elasticsearch
using Foundatio.Repositories.Models;
public class Employee : IIdentity, IHaveDates, ISupportSoftDeletes
{
public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public int Age { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
public bool IsDeleted { get; set; }
}
using Foundatio.Repositories.Elasticsearch.Configuration;
public sealed class EmployeeIndex : VersionedIndex<Employee>
{
public EmployeeIndex(IElasticConfiguration configuration)
: base(configuration, "employees", version: 1) { }
public override TypeMappingDescriptor<Employee> ConfigureIndexMapping(
TypeMappingDescriptor<Employee> map)
{
return map
.Dynamic(false)
.Properties(p => p
.SetupDefaults()
.Text(f => f.Name(e => e.Name).AddKeywordAndSortFields())
.Text(f => f.Name(e => e.Email).AddKeywordAndSortFields())
.Number(f => f.Name(e => e.Age).Type(NumberType.Integer))
);
}
}
using Foundatio.Repositories;
using Foundatio.Repositories.Elasticsearch;
public interface IEmployeeRepository : ISearchableRepository<Employee> { }
public class EmployeeRepository : ElasticRepositoryBase<Employee>, IEmployeeRepository
{
public EmployeeRepository(MyElasticConfiguration configuration)
: base(configuration.Employees) { }
}
// Add
var employee = await repository.AddAsync(new Employee
{
Name = "John Doe",
Email = "john@example.com",
Age = 30
});
// Query
var results = await repository.FindAsync(q => q
.FilterExpression("age:>=25")
.SortExpression("name"));
// Update
employee.Age = 31;
await repository.SaveAsync(employee);
// Soft delete
employee.IsDeleted = true;
await repository.SaveAsync(employee);
// Hard delete
await repository.RemoveAsync(employee);
IReadOnlyRepository<T> - Read operations (Get, Find, Count, Exists)IRepository<T> - Write operations (Add, Save, Remove, Patch)ISearchableRepository<T> - Dynamic querying with filters, sorting, and aggregationsEntityChanged messages)ChangeType.Removed)IsDeletedActiveOnly, DeletedOnly, AllIndex<T> - Basic index configurationVersionedIndex<T> - Schema versioning with migrationsDailyIndex<T> - Time-series with daily partitioningMonthlyIndex<T> - Time-series with monthly partitioningDocumentsAdding / DocumentsAddedDocumentsSaving / DocumentsSavedDocumentsRemoving / DocumentsRemovedDocumentsChanging / DocumentsChangedBeforeQuery - Query interceptionBeforePublishEntityChanged - Notification interceptionVisit the full documentation for detailed guides:
See the for a complete working example.
We welcome contributions! Please see our for details.
Licensed under the Apache License, Version 2.0. See for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Foundatio.Repositories.Elasticsearch:
| Package | Downloads |
|---|---|
|
NetProOA.Framework.ES
ESζε‘ |
Showing the top 1 popular GitHub repositories that depend on Foundatio.Repositories.Elasticsearch:
| Repository | Stars |
|---|---|
|
exceptionless/Exceptionless
Exceptionless application
|
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0-beta1 | 101 | 5/12/2026 |
| 7.18.3 | 1,140 | 5/12/2026 |
| 7.18.2 | 388 | 5/9/2026 |
| 7.18.1 | 413 | 4/28/2026 |
| 7.18.0 | 294 | 4/25/2026 |
| 7.18.0-beta6 | 206 | 4/15/2026 |
| 7.18.0-beta4 | 125 | 2/27/2026 |
| 7.18.0-beta3 | 162 | 2/14/2026 |
| 7.18.0-beta2 | 117 | 2/14/2026 |
| 7.18.0-beta1 | 326 | 1/12/2026 |
| 7.17.17 | 8,539 | 8/21/2025 |
| 7.17.16 | 292 | 8/20/2025 |
| 7.17.15 | 467 | 5/9/2025 |
| 7.17.14 | 802 | 1/31/2025 |
| 7.17.13 | 680 | 11/26/2024 |
| 7.17.12 | 573 | 9/28/2024 |
| 7.17.11 | 337 | 8/31/2024 |
| 7.17.10 | 226 | 8/31/2024 |
| 7.17.9 | 8,370 | 5/20/2024 |
| 7.17.8 | 4,838 | 3/27/2024 |