Repository navigation
EntityAxis v0.2.0
Pre-release
Pre-release
✨ Features
- Introduced
IKeyMapper<TAppKey, TDbKey>abstraction for mapping between application-layer and database-layer entity keys - Added built-in key mapper implementations:
IdentityKeyMapper<T>for cases where key types matchStringToGuidKeyMapperfor mapping string IDs to Guid database keysStringToIntKeyMapperfor mapping string IDs to int database keys
- Updated all internal EntityAxis logic to support separate
TKeyandTDbKeygeneric parameters across services and handlers - Extended the Entity Framework integration to handle
TDbKeyresolution consistently using the registered key mapper
🛠 Fixes
- Improved update handling to use mapped database keys via
IKeyMapperbefore invokingFindAsync - Internal exception messages now display the original (application-layer) key value when entities are not found, improving traceability
⚠️ Breaking Changes
- Services like
EntityFrameworkQueryServiceandEntityFrameworkCommandServicenow support an additionalTDbKeyparameter - Consumers implementing custom EF-based repositories or overrides must account for the
TDbKeytype and inject a suitableIKeyMapperimplementation
🛠 Migration Notes
-
🔧 All applications must now explicitly register an
IKeyMapper<TAppKey, TDbKey>for each entity type used- This is required even if
TAppKeyandTDbKeyare the same (e.g., both areGuid)
- This is required even if
-
If your application and database key types match, use:
services.AddSingleton<IKeyMapper<Guid, Guid>, IdentityKeyMapper<Guid>>();
-
If your application uses a string ID mapped to a database Guid, use:
services.AddSingleton<IKeyMapper<string, Guid>, StringToGuidKeyMapper>();
-
📦 Make sure to reference the
EntityAxis.KeyMapperspackage to access built-in key mapper implementations