Bsft.Core
2.3.0
dotnet add package Bsft.Core --version 2.3.0
NuGet\Install-Package Bsft.Core -Version 2.3.0
<PackageReference Include="Bsft.Core" Version="2.3.0" />
<PackageVersion Include="Bsft.Core" Version="2.3.0" />
<PackageReference Include="Bsft.Core" />
paket add Bsft.Core --version 2.3.0
#r "nuget: Bsft.Core, 2.3.0"
#:package Bsft.Core@2.3.0
#addin nuget:?package=Bsft.Core&version=2.3.0
#tool nuget:?package=Bsft.Core&version=2.3.0
Bsft.Core
The primitives every other Bsft.* package builds on: the exception hierarchy the HTTP layer maps to
status codes, the validation contracts, the Unit type commands return when they produce no result,
the poll loop background services share, the IRetryAfter seam a failure asks to be tried later
through, the two unit-of-work contracts the framework states its persistence boundaries in, and the
closure calculator every closure table in the framework is maintained with, and the one canonical rule for e-mail
addresses and domain names (InternetDomain, EmailAddress: UTS 46 to A-labels, deterministic on every platform; see
docs/core.md).
Install
dotnet add package Bsft.Core
No further Bsft packages; it depends on the BCL alone and is pulled transitively by every other package in the framework.
Register
Nothing to register. Bsft.Core contributes no services and therefore has no
AddBsftCore — it is a package of contracts, exceptions and value types that other packages
register implementations for. IPollLoop, IValidator<T> and IStartupValidator are registered by
whichever package supplies the implementation. IClosureCalculator is registered by each package
that keeps a closure table, with TryAddSingleton<IClosureCalculator, ClosureCalculator>(), so the
first registration wins.
Configure
None. The package binds no configuration section and exposes no options type.
| Option | Default | Effect |
|---|---|---|
| — | — | — |
Validation: none.
Extend
ISubjectDataEraser (a package deletes what it stores per account, in the Revoke phase for what grants access or the Data phase for the rest; run by IDirectoryAccountAdministrationService.DeleteAsync in Bsft.Auth.Oidc.Organization: idempotent, children before parents, no authorization) and SubjectDataErasurePhase; IAccountDeletionSource (a registration that announces that accounts can be deleted, which Bsft.Auth.Idp checks at startup against its account-status reader).
IPollLoop (runs a poll pass until the service stops; PollLoop is the implementation and takes an
interval and a pass delegate), IPollReporter (phrases the three things the loop has to say, so a
service logs in its own vocabulary rather than the loop's), IValidator<T> (validates one instance
and answers a ValidationResult), IStartupValidator (checks configuration once at startup and
answers a StartupValidationResult), IRetryAfter (an exception saying when the work it failed should
be attempted again, so the code that learned of a wait does not sleep in a pipeline it shares; implement
it on an exception type you already have, or throw the ready-made RetryAfterException).
IUnitOfWork (commits whatever the scope staged, which is how a package that writes through the
host's storage closes its own unit of work — a background sweep, for one, has no change of its own to
ride along with) and ITransactionalUnitOfWork (runs several writes as one unit, handed over as a
delegate so a retrying provider can re-run the whole unit rather than resume it half-committed).
Neither names a DbContext; Bsft.Data ships DbContextUnitOfWork<TContext> behind both.
IAmbientTransaction (an ITransactionalUnitOfWork spanning every store enlisted in the scope, which a
unit started inside it joins; IsActive tells a retrying component that only the outermost unit may be
retried, and IsTransactionConflict passes on the provider's conflict classification). Bsft.Data ships
the shared transaction behind it. AmbientTransactionMisuseException (an InvalidOperationException) is
what it throws for a use that fails the same way on every attempt, which a retrying component leaves alone.
IClosureCalculator (computes the ancestor and descendant rows of a tree given as (Id, ParentId)
pairs, generic in the row: the caller passes a (ancestorId, descendantId, depth) factory for its own
closure entity; ClosureCalculator is the implementation).
ObserverComposite<TObserver>, IObserverGuard/ObserverGuard and IObserverFailureReporter (tell every
observer of an event in order and contain an observer's failure, reporting it through a reporter the host
supplies; AddBsftObservers in Bsft.Hosting wires a logging one), KeyedGate<TKey> (one first-in-first-out
gate per key, entries removed when the last user leaves) and SlotPool (a fixed number of slots, admitted in
the order callers asked, cancellation semantics documented in docs/core.md).
BsftException is the one type here designed for inheritance:
derive an application exception from it and BsftExceptionMiddleware will map it and carry its
error code. Every exception the framework itself ships below that base is sealed.
IHostedWorkStartGate (a precondition every framework hosted loop waits for before it starts: the schema is migrated, a warm-up is done; WaitAsync(CancellationToken)), IHostedWorkStartGateOverdueSignal (the optional IsOverdue() a health check reads). The loops themselves know nothing about gates: they are registered with AddBsftGatedHostedService<T>() from Bsft.Hosting.StartGates, which holds them back. See docs/hosting.md.
Documentation
Topic page: docs/core.md. Conventions: docs/package-conventions.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (20)
Showing the top 5 NuGet packages that depend on Bsft.Core:
| Package | Downloads |
|---|---|
|
Bsft.Data
BSFT Framework data layer: query filtering, full-text search, pagination, multi-tenancy |
|
|
Bsft.Http
BSFT Framework HTTP primitives: strong entity tags from a content digest or a concurrency token, canonical content hashing, conditional-GET (If-None-Match / 304) handling and the strong If-Match comparison conditional writes are gated on |
|
|
Bsft.Mediator.Abstractions
BSFT Framework CQRS mediator contracts: ICommand, IQuery, INotification, their handlers, IMediator, IPipelineBehavior and related abstractions. |
|
|
Bsft.Retention
BSFT Framework retention: a hosted sweeper that drives one bounded purge pass per set of records a package owns |
|
|
Bsft.Mediator
BSFT Framework CQRS mediator: IMediator, commands, queries, notifications, pipeline behaviors |
GitHub repositories
This package is not used by any popular GitHub repositories.