Internal Dream Consistency lightweight entity manager and transaction context library for SQL-based backend services.
DreamConsistency.EntityManager is an internal shared package used as a lightweight
data access foundation for Dream Consistency backend services.
It provides transaction context infrastructure, strongly typed entity sets,
expression-based querying, raw SQL execution, simple change tracking, and MySQL/MariaDB result mapping.
| Property | Current Decision |
|---|---|
| Package ID | DreamConsistency.EntityManager |
| First NuGet Release | 1.0.0 |
| Target Framework | .NET Standard 2.1 |
| Primary Database Strategy | MySQL / MariaDB |
| NuGet Feed | https://nuget.dreamconsistency.com/v3/index.json |
| Package Hosting | BaGetter on Dream Consistency Hub server. |
| Release Pipeline | DreamConsistency.EntityManager - NuGet Release |
| Jenkins Folder | DreamConsistency - Packages |
| Versioning | Semantic Versioning: MAJOR.MINOR.PATCH |
| Visibility | Internal Dream Consistency package. |
The purpose of this package is to provide reusable internal data-access infrastructure for backend services without introducing a full ORM.
| Area | Responsibility |
|---|---|
| Transaction Context | Base transaction lifecycle, save, commit, rollback, dispose, and raw SQL execution. |
| Entity Sets | Strongly typed table-like access through DbEntitySet<TEntity>. |
| Querying | Expression-based methods such as WhereAsync, AnyAsync, and LoadAsync. |
| Change Tracking | Tracks added, modified, and deleted entities before saving changes. |
| Raw SQL | Executes explicit SQL queries and maps result sets to entity or DTO classes. |
| Result Mapping | Maps SQL result columns to C# properties by matching column/property names. |
The package provides the infrastructure. Each product creates its own concrete context and exposes its own entity sets.
A consuming application creates its own context by inheriting from TransactionContext.
For example, Legislator can have a TenantTransactionContext, while Hestino can later have
its own Hestino-specific transaction context.
TenantTransactionContext is an example of package consumption.
It should not be part of DreamConsistency.EntityManager because it is product-specific.
Typical expression-based query using a concrete transaction context:
Tenant filtering is explicit and belongs to the consuming application. The package does not automatically add tenant filters.
Typical entity creation and change tracking usage:
The most important rule is to keep the package reusable and product-neutral.
| Allowed in Package | Not Allowed in Package |
|---|---|
TransactionContext |
TenantTransactionContext |
DbEntitySet<TEntity> |
TaskQueryMethods |
DbEntitySetChangeTracker<TEntity> |
Legislator-specific query methods |
EntityState |
Hestino-specific query methods |
StorageType |
Generated product table classes |
PrimaryKey attribute |
Business rules |
| SQL strategy abstractions | Connection strings and secrets |
| MySQL strategy implementation | Controllers and API endpoints |
Consuming projects must include the internal Dream Consistency NuGet feed.
Install the package:
Package releases are done manually through Jenkins after changes are merged to master.
1.0.0 is already published, the next release must be 1.0.1,
1.1.0, or another valid SemVer version.
| Setting | Value |
|---|---|
| Jenkins Folder | DreamConsistency - Packages |
| Job Name | DreamConsistency.EntityManager - NuGet Release |
| Repository | git@bitbucket.org:skyrocket_novisad/dreamconsistency.entitymanager.git |
| Branch | master |
| Jenkinsfile | Jenkinsfile |
| Build Agent | mcr.microsoft.com/dotnet/sdk:10.0 |
| BaGetter Credential | dreamconsistency-nuget-api-key |
| Bitbucket Credential | Dream Consistency Core Architecture Project Access Key |
The package uses Semantic Versioning.
| Version Type | Example | Meaning |
|---|---|---|
| Patch | 1.0.1 |
Bug fix with no breaking changes. |
| Minor | 1.1.0 |
New functionality with no breaking changes. |
| Major | 2.0.0 |
Breaking changes. |
| Risk / Note | Decision |
|---|---|
| Not a full ORM | The package is intentionally lightweight and should not be treated as Entity Framework replacement. |
| Tenant filtering | Tenant filtering must be explicit in product query methods. |
| Raw SQL | Raw SQL should use parameters and avoid string concatenation with user input. |
| Database support | MySQL / MariaDB is the primary supported strategy. |
| Product-specific code | Must stay outside the package. |
| Breaking changes | Any change to public APIs, transaction behavior, mapping behavior, or query generation requires careful versioning. |
Detailed developer documentation is maintained in the repository README.md.
This Wiki page is the central operational reference for ownership, boundaries,
release flow, and package usage decisions.
| Date | Change | Author |
|---|---|---|
| 2026-07-04 | Initial documentation page created for DreamConsistency.EntityManager. |
Branko |
| 2026-07-04 | First internal NuGet release pipeline created and package published to BaGetter. | Branko |