OElite.Data 5.0.9-develop.7331
OElite.Data
Core data access layer: generic repository, DbCentre base, and MongoDB integration primitives for OElite applications.
Overview
OElite.Data provides the foundational data access patterns for OElite applications. It defines the DataRepository<T> generic repository, the DbCentre base class for MongoDB-backed data centres, and the IDataRepository contract that all repositories implement.
This package is consumed by both the OElite.Common.Hosting services layer (for dependency injection wiring) and by every application-specific repository that extends DataRepository<T> to add entity-specific queries.
Features
📚 Repository Pattern
DataRepository<T>: Generic repository base class providing standard CRUD operationsIDataRepository: Interface contract for all repositories (enables mocking and substitution)- Type-safe entity operations with async/await throughout
🗄️ DbCentre Base
- MongoDB Integration: Base class for MongoDB-backed data centres
- Connection lifecycle management
- Collection accessor utilities
- Logging integration with
IAppConfig
🔌 Extensibility
- Subclassable for application-specific repositories
- Supports custom query methods per entity type
- Compatible with OElite.Restme.MongoDb for advanced MongoDB features
Quick Start
1. Installation
dotnet add package OElite.Data
2. Define a Custom Repository
using OElite.Data;
using OElite.Restme.Utils;
public class ProductRepository : DataRepository<Product>
{
public ProductRepository(DbCentre dbCentre) : base(dbCentre) { }
public Task<List<Product>> GetByCategoryAsync(string categoryId)
{
return FindAsync(p => p.CategoryId == categoryId);
}
}
Dependencies
- OElite.Restme 2.x (MongoDB driver, IRestme provider)
- OElite.Restme.Utils 2.x (BaseEntity, attributes)
Related Packages
- OElite.Data.Platform - Platform-specific repositories, PlatformDb, and platform index management
- OElite.Common.Hosting - DI auto-discovery and configuration
License
Copyright (c) Phanes. All rights reserved.
Showing the top 20 packages that depend on OElite.Data.
| Packages | Downloads |
|---|---|
|
OElite.Common.Hosting
Package Description
|
3,900 |
|
OElite.Services
Package Description
|
3,900 |
|
OElite.Services
Package Description
|
1,020 |
|
OElite.Services
Package Description
|
685 |
|
OElite.Common.Hosting
Package Description
|
681 |
|
OElite.Common.Hosting
Package Description
|
515 |
|
OElite.Services
Package Description
|
49 |
|
OElite.Common.Hosting
Package Description
|
47 |
|
OElite.Common.Hosting
Package Description
|
22 |
|
OElite.Services
Package Description
|
20 |
|
OElite.Data.Platform
Package Description
|
18 |
|
OElite.Core
Package Description
|
17 |
|
OElite.Core.Web
Package Description
|
14 |
|
OElite.Data.Platform
Package Description
|
14 |
|
OElite.Common.Hosting
Package Description
|
14 |
|
OElite.Services
Package Description
|
14 |
|
OElite.Common.AspNetCore
Package Description
|
11 |
|
OElite.Services
Package Description
|
9 |
|
OElite.Data.Platform
Package Description
|
9 |
|
OElite.Data.Platform
Package Description
|
8 |
.NET 10.0
- OElite.Common (>= 5.0.9-develop.7331)
- OElite.Restme.MongoDb (>= 2.1.1-develop.2409)
- OElite.Restme.Utils (>= 2.1.1-develop.2409)