Skip to content

0.10: Add DI, hosting, and explicit unit-of-work support #108

Description

@bazer

Objective

Make DataLinq a deliberate, lifetime-safe component of ASP.NET Core and Generic Host applications through an explicit host-integration package, injectable read access, and an explicit mutable unit-of-work boundary.

Required scope

  • Define a host-integration package boundary without imposing an ASP.NET Core dependency on the core runtime.
  • Register generated database models and current providers with validated options.
  • Separate injectable read access from explicit mutable unit-of-work ownership.
  • Add a unit-of-work factory whose instances own transaction begin, commit, rollback, cancellation, disposal, and terminal-state reporting.
  • Document singleton/scoped/transient ownership for provider state, generated roots, connections, transactions, units of work, and hosted services.
  • Integrate with Generic Host logging.
  • Preserve existing SQL mutable-instance trust rules across failed commit, cancellation, rollback failure, and disposal.
  • Make shutdown and disposal deterministic and exactly once.

Acceptance criteria

  • ASP.NET Core and worker-style Generic Host fixtures resolve read services and execute one explicit unit of work.
  • Concurrent scopes cannot accidentally share transaction or mutable unit-of-work state.
  • Begin, commit, rollback, cancellation, failure, uncertain outcome, and disposal paths have focused contract tests.
  • Nested application services can participate through explicit ownership without an ambient session.
  • Host shutdown disposes every owned resource exactly once.
  • New packages are included in central versioning, pack inventory, package inspection, compatibility checks, and consumer smoke without leaking unnecessary dependencies.
  • Focused H10 evidence is recorded in 0.10: Produce release evidence and frozen-candidate closeout #106 before this issue closes.

Dependency and order

Explicit non-goals

  • Implicit ambient transactions or an AsyncLocal session.
  • Automatic transactions for ordinary reads.
  • Automatic migrations at startup.
  • Named or keyed database registrations in 0.10.
  • Framework-specific XAML packages.

Planning sources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions