Building blocks
CodeBlock DevKit documentation groups building blocks you reuse across your SaaS in four areas:
Domain model — primitives from
CodeBlock.DevKit.Domain(entities, aggregate roots, domain events, specifications, repository contracts, value objects, and related types) so yourCoreproject can express Domain-Driven Design (DDD) without re-implementing identity, versioning, events, and persistence contracts from scratch.Services — cross-cutting injectable contracts such as
IRequestDispatcher,ICurrentUser,INotificationService,IEncryptionService, andIFileService(namespaces and embedded source on the Services page).Dependency injection — Core, supporting, and web client modules register their work behind interfaces; you inject those interfaces from UI, use cases, application services, and infrastructure (overview on the Dependency injection page).
Utilities — cross-cutting helpers in
CodeBlock.DevKit.Core: string and date extensions,Result/Result<T>, query options, serialization, input validation, and shared data-annotation attributes. They keep everyday checks and envelopes consistent across domain, application, infrastructure, and UI code.
Result is the same success/failure contract the MediatR pipeline and your APIs use; for how failures become Result.Errors, read Exception handling. Serializer (and related helpers) appear when logging or diagnostics need safe snapshots of objects—see Logging for [DoNotLog] and redaction.
Where to go next
- Domain Model — Namespaces and embedded source for each Domain primitive.
- Services — Cross-cutting injectable contracts (
IRequestDispatcher,ICurrentUser, and related types). - Dependency injection — How DevKit registers module services so you can inject their interfaces from UI, use cases, and services.
- Utilities — Namespaces and embedded source for
CodeBlock.DevKit.Coreextensions, helpers, and validation attributes.
For how the SaaS template applies these ideas to a real feature (DemoThing), see Domain model under Building your product. For the conceptual tour of DDD on this stack, see Domain modeling.