Commit Graph
2 Commits
Author SHA1 Message Date
mostalive 8b46fccf08 Add static Context (Singleton) to DbBase
ActiveRecord pattern: expose a shared DbContext on DbBase so any
entity subclass can reach it without passing context through parameters.
The instance-level DbContext back-reference still works; the static one
provides a class-level global fallback.
2026-09-14 20:48:21 +01:00
mostalive 463245288a Yak: csharp before situation (Yak 01) — DB-backed domain classes
Add the C# BEFORE situation: a fake-EF DbContext + DbBase that Client/Order
inherit, the active-record DbContext back-reference (the dependency leak),
navigation fix-up on Client.Orders, and a WebApp that consumes the domain
classes directly. Adds an empty After project so the solution shape is final,
and an xUnit BeforeTests suite covering the required assertions.

- db-subclass-to-dto.sln (classic .sln; SDK 10 defaults to .slnx which breaks run-tests.sh)
- src/Before: DbBase, DbContext, Client (+ClientOrders fix-up), Order, WebApp
- src/After: empty placeholder (filled in Yak 02)
- tests/BeforeAfter.Tests/BeforeTests.cs: 8 tests (7 required + 1 companion)
2026-09-11 13:03:09 +01:00