- DbBase.FindRequired / Client.FindByNameRequired now throw the
domain-specific ObjectNotFoundException (NHibernate lineage; Rails
equivalent: ActiveRecord::RecordNotFound) on a lookup miss; the
no-context case stays InvalidOperationException (configuration error)
- Console demo catches the new type; tests (18)/(21) assert it,
(19)/(23) keep InvalidOperationException with rationale comments
- scripts/run-console.sh delegates to dotnet.sh; run-console.ps1 is
the Windows/PowerShell counterpart (mise-first, repo-root cd)
Yak: objectnotfoundexception-run-console-wrappers-3p8b
DbBase.Find<T> now uses db ?? Context, and Client.FindByName's context
parameter becomes optional — call sites read like Client.FindByName("Jane
Doe") without context threading. A null result now overwhelmingly means
"no match"; the residual "no context configured at all" ambiguity is
documented in remarks as part of the ActiveRecord-leak cost this exercise
illustrates.
Scaffold Before.Console project referencing the Before library.
Implements a straight-line demo that creates clients/orders, saves
them via DbBase.Context (singleton), lists all clients with orders,
and finds a client by name using Client.FindByName().