RA.Utilities.Data.Entities
The primary purpose of the RA.Utilities.Data.Entities package is to provide a standardized and reusable foundation for data entities within your applications.
It establishes a common structure for all your data models, which helps to reduce repetitive (boilerplate) code and enforce consistency across your project.
Base Classes for Common Properties:
The package provides several base classes that you can inherit from, so you don't have to redefine common properties in every single entity class you create.
- BaseEntity:
This is the most fundamental base class.
When your entity inherits from it, it automatically gets properties for its unique identifier and timestamps (
Id,CreatedDate,UpdatedDate). - AuditableBaseEntity:
This class inherits from
BaseEntityand adds properties to track who created or modified the entity (CreatedBy,LastModifiedBy). This is very useful for auditing purposes. - SoftDeleteEntity:
This class also inherits from
BaseEntityand adds anIsDeletedflag. This enables "soft-delete" functionality, where records are marked as deleted but not physically removed from the database, preserving data history.
🧩 How It Fits into the Ecosystem
The RA.Utilities.Data.Entities package is a foundational piece of the RA.Utilities ecosystem.
The abstractions it provides are consumed by other packages, such as RA.Utilities.Data.Abstractions and RA.Utilities.Data.EntityFramework.
In short, RA.Utilities.Data.Entities solves the common problem of defining the basic structure of data models,
allowing you to focus on the unique properties of your entities while ensuring a consistent and maintainable data layer.
🛠️ Installation
You can install the package via the .NET CLI:
dotnet add package RA.Utilities.Data.Entities
Or through the NuGet Package Manager console:
Install-Package RA.Utilities.Data.Entities
📄️ BaseEntity
The BaseEntity class serves as the foundation for all entities within your data model.
📄️ SoftDeleteEntity
The SoftDeleteEntity class is designed to implement the soft-delete pattern for your data entities.
📄️ AuditableBaseEntity
The primary purpose of the AuditableBaseEntity class is to extend the functionality of BaseEntity by adding auditing capabilities.