Vital Core Extraction
Problem Statement
The EITWEP.Model project is the "Anchor of the Monolith". It contains:
- 840 EntityClasses (LLBLGen-generated)
- 369 EntityPartials with custom logic
- 1,985 Business files with mixed concerns
This layer is heavily coupled with System.Web, System.Drawing, and custom legacy interfaces, preventing it from being used in a modern .NET environment (.NET 10+).
Objective
Decouple the Vital Core from EITWEP.Model to enable:
- Modern API Development – New .NET 10 services can reference the same entities
- Headless Execution – Background jobs and CLI tools without HttpContext
- Reduced Coupling – Clear separation between data, abstractions, and domain logic
Target Architecture
| Component | Target | Contains |
|---|---|---|
| Wep.Core.Abstractions | .NET Standard 2.1 | IWepActivityable, ICommunicable, IEITLogItemable |
| Wep.Core.Data | .NET Standard 2.1 | EntityClasses, WEPV2DataContext configuration |
| Wep.Core.Domain | .NET Standard 2.1 | Pure business logic, static helpers |
| EITWEP.Model | .NET 4.8 (Shim) | Type Forwarding, Impure Logic |
Implementation Phases
| Phase | Objective | Timeline |
|---|---|---|
| A | Create Wep.Core.Abstractions with portable interfaces | Week 1 |
| B | Extract entities to Wep.Core.Data with Type Forwarding | Week 2-3 |
| C | Separate pure domain logic to Wep.Core.Domain | Week 4+ |
Documents
| Document | Description | Status |
|---|---|---|
| Session 1 Analysis | Technical deep-dive, risk assessment, architecture proposal | 🟠 DRAFT |
| Implementation Plan | Phased approach, verification steps, rollback strategy | 🟠 DRAFT |
Key Risks
| Risk | Severity | Mitigation |
|---|---|---|
| Breaking 10+ dependent projects | 🔴 Critical | Type Forwarding |
SaveChanges() fails without HttpContext | 🔴 High | IHttpContextAccessor injection |
| Interface circular dependencies | 🟡 Medium | Abstractions shim layer |
| LLBLGen regeneration overwrites | 🟡 Medium | Never touch generated files |
Open Decisions
[!CAUTION] Decision Required: Should
Wep.Core.*libraries be Project References or NuGet Packages?