Refactor repository pattern and mark methods obsolete

Updated `IRepository<TEntity>` to introduce new reading methods and mark existing ones as obsolete. The `CRUDRepository` class is now deprecated, encouraging a transition to alternative implementations. Significant changes in `DbRepository<TDbContext, TEntity>` include the removal of old read methods in favor of a new `Read` method returning `IReadQuery<TEntity>`. Added a `ReadQuery<TEntity>` class to enhance querying capabilities with a fluent API. Obsolete methods are organized under a `#region Obsolete` directive for better management.
This commit is contained in:
Developer 02
2025-05-20 10:35:27 +02:00
parent 5995b334eb
commit f7e2bb2434
4 changed files with 79 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ namespace DigitalData.Core.Infrastructure
/// This repository abstracts the common database operations, offering an asynchronous API to work with the entity's data.
/// It leverages the EF Core's DbContext and DbSet to perform these operations.
/// </remarks>
[Obsolete("Use Repository")]
public class CRUDRepository<TEntity, TId, TDbContext> : ICRUDRepository<TEntity, TId>
where TEntity : class
where TDbContext : DbContext