ADR-005: Data Layer as Shared .NET Standard Project
Status: Proposed
Date: 2026-01-20
Context: Enabling Hybrid Strangler Fig Architecture
Decision
The Data Layer (EITWEP.Model) is extracted as a Shared Library targeting .NET Standard 2.1, enabling consumption by both .NET Framework 4.8 and .NET 8+ applications.
Context
The Hybrid Strangler Fig strategy (ADR-002) requires both legacy and modern applications to share the same data model without code duplication.
Discovery: Entity Framework 6.4.4 (used in EITWEP.Model) is compatible with .NET Standard 2.1, making this extraction possible.
Technical Details
Compatibility Matrix
| Component | .NET Framework 4.8 | .NET Standard 2.1 | .NET 8 |
|---|---|---|---|
EITWEP.Model | ✅ Current | ✅ Target | ✅ Via .NET Standard |
| Entity Framework 6.4.4 | ✅ | ✅ | ✅ |
System.Web dependencies | ⚠️ Must remove | ❌ | ❌ |
Required Changes
- Remove
System.WebReferences: AnyHttpContext.Currentusage in the Model must be refactored to dependency injection. - Extract to New Project: Create
EITWEP.Model.Sharedtargetingnetstandard2.1. - Update References: Both Legacy App and Modern API reference the shared project.
Rationale
Sharing the Data Layer:
- Single Source of Truth: No entity drift between apps.
- Incremental Migration: Logic can be moved piece by piece.
- Testing: Same entities can be tested in both environments.
Consequences
- Build Complexity: Multi-targeting requires careful project configuration.
- No Breaking Changes: The shared library must maintain backward compatibility.
- Future Path: When legacy app is fully strangled, the .NET Standard constraint can be removed.