Deveel Repository
Deveel
  • Why Another Repository Pattern Library?
  • The Repository Pattern
  • Getting Started
  • Customize the Repository
  • Multi-Tenancy of Data Sources
  • User Entities
  • Repository Implementations
    • In-Memory Repositories
    • Entity Framework Core Repositories
    • MongoDB Repositories
  • The Entity Manager
    • Caching Entities
Powered by GitBook
On this page
Edit on GitHub
  1. Repository Implementations

In-Memory Repositories

PreviousRepository ImplementationsNextEntity Framework Core Repositories

Last updated 1 year ago

Feature
Status
Notes

Base Repository

Filterable

Queryable

Native .NET Queryable functions

Pageable

Multi-tenant

The InMemoryRepository<TEntity> class is an implementation of the repository pattern that stores the data in-memory.

You can register an instance of the repository in the dependency injection container using the AddInMemoryRepository<TEntity> extension method of the IServiceCollection interface:

public void ConfigureServices(IServiceCollection services) {
	services.AddInMemoryRepository<MyEntity>();
}

Filtering Data

The InMemoryRepository<TEntity> implements both the IQueryableRepository<TEntity> and the IFilterableRepository<TEntity> interfaces, and allows to query the data using the LINQ syntax, or using instances of the IQueryFilter interface.

The only supported filter type is the ExpressionFilter<TEntity> that is backed by a lambda expression of type Expression<Func<TEntity, bool>>.

✅
✅
✅
✅
❌