RA.Utilities.Data.Abstractions
Version 10.0.0
Updates the version from 10.0.0-rc.2 (release candidate) to 10.0.0, signifying the transition to a stable release.
This change indicates that the library is now considered complete and ready for general use, reflecting confidence in its stability and functionality.
Version 10.0.0-rc.2
This release of RA.Utilities.Data.Abstractions provides a collection of essential data access abstractions, including the Repository and Unit of Work patterns. This library is the foundation for creating a decoupled and testable data access layer in .NET applications.
✨ Key Features
-
Generic Repository Interfaces:
IRepositoryBase<T>: A comprehensive interface for standard CRUD (Create, Read, Update, Delete) operations.IReadRepositoryBase<T>&IWriteRepositoryBase<T>: Segregated interfaces to better support the Command Query Separation (CQS) principle.
-
IUnitOfWorkInterface:- Provides a contract for managing transactions and persisting changes across multiple repositories.
- Includes a
SaveChangesAsync()method to commit all changes in a single, atomic operation, ensuring data integrity.
-
IDbContextInterface:- An abstraction for
DbContextthat allows your repository implementations to be decoupled from a concrete Entity Framework Core context, which greatly improves testability.
- An abstraction for
-
Decoupling & Testability: By depending on these abstractions instead of concrete data access technologies, your application and business logic remain persistence-ignorant, making them easier to mock and test.
🚀 Getting Started
-
Define Your Entities: Create your entities using the base classes from
RA.Utilities.Data.Entities.public class Product : BaseEntity { /* ... */ } -
Define Repository Interfaces: In your application/domain layer, create specific repository interfaces.
public interface IProductRepository : IRepositoryBase<Product>
{
// Add custom query methods here
} -
Implement in Infrastructure: Create concrete implementations of these interfaces in your infrastructure layer, typically using the
RA.Utilities.Data.EntityFrameworkpackage. -
Inject and Use: Inject
IProductRepositoryandIUnitOfWorkinto your services.