This is the primary Assembly that provides the core fundamental capabilities of Beef. The key classes and/or underlying NameSpaces are desribed.
This is the base set of capabilities (classes) available within Beef; the following are of specific note:
The ExecutionContext
is a foundational class that is integral to the underlying execution. It represents a thread-bound (request) execution context - enabling the availability of the likes of Username
at anytime. The context is passed between executing threads for the owning request.
An implementor may choose to inherit from this class and add additional capabilities as required.
There are a number of key exceptions that have a specific built in behaviour; these all implement IBusinessException
.
Exception | Description | HTTP Status | ErrorType |
SQL |
---|---|---|---|---|
AuthenticationException |
Represents an Authentication exception. | 401 Unauthorized | 8 AuthenticationError | n/a |
AuthorizationException |
Represents an Authorization exception. | 403 Forbidden | 3 AuthorizationError | spThrowAuthorizationException |
BusinessException |
Represents a Business exception whereby the message returned should be displayed directly to the consumer. | 400 BadRequest | 2 BusinessError | spThrowBusinessException |
ConcurrencyException |
Represents a data Concurrency exception; generally as a result of an errant ETag. | 412 PreconditionFailed | 4 ConcurrencyError | spThrowConcurrencyException |
ConflictException |
Represents a data Conflict exception; for example creating an entity that already exists. | 409 Conflict | 6 ConflictError | spThrowConflictException |
DuplicateException |
Represents a Duplicate exception; for example updating a code on an entity where the value is already used. | 409 Conflict | 7 DuplicateError | spThrowDuplicateException |
NotFoundException |
Represents a NotFound exception; for example updating a code on an entity where the value is already used. | 404 NotFound | 5 NotFoundError | spThrowNotFoundException |
ValidationException |
Represents a Validation exception with a corresponding Messages collection. |
400 BadRequest | 1 ValidationError | spThrowValidationException |
The LText
represents a localization text key/identifier to be used by the TextProvider
to access the underlying localized text representation. This is baked into Beef whereever end user texts are intended to be output.
The InvokerBase
represents the base class that enables an Invoke
to be wrapped so that standard functionality can be added to all invocations. For example: Retry, Circuit Breaker, Exception Handling, Database Transactions, etc.
Beef uses this extensively within the solution layering and other componenents such as data access to enable this capability to be easily injected into the execution pipeline.
Provides the key capabilities to enable the rich business entity functionality central to Beef.
The EntityBasicBase
provides the basic entity capabilities:
- Standardised
SetValue
methods to enable capabilities such asStringTrim
,StringTransform
,DateTimeTransform
. - Property immutability support; i.e. value can not be changed once set.
- Entity readonly support (
MakeReadOnly
andIsReadOnly
). - Entity changed support (
IsChanged
andAcceptChanges
). - Implements
INotifyPropertyChanged
forPropertyChanged
event.
The EntityBase
provides the rich entity capabilities (inherits from EntityBasicBase
):
- Implements
IEditableObject
forBeginEdit
,EndEdit
andCancelEdit
. - Implements
IEquatable
forEquals
andGetHashCode
. - Implements
ICleanUp
forCleanUp
andIsInitial
. - Implements
IUniqueKey
forUniqueKey
. - Implements
IChangeTrackingLogging
forTrackChanges
andChangeTracking
. - Implements
ICopyFrom
andICloneable
forCopyFrom
andClone
respectively.
Note: The entity code-generation will ensure that the EntityBase
and corresponding capabilities, specifically the SetValue
, are implemented correctly.
The EntityBaseCollection
encapsulates an ObservableCollection<T>
to provide the base class for all entity collections enabling a consistent and rich experience.
The EntityCollectionResult
provides a standardised mechanism to manage a collection Result
, that may also contain corresponding Paging
details where required.
The MessageItem
and MessageItemCollection
provide a means to manage messages (Type
, Text
and optional Property
) used for the likes of validation error messages, etc.
The ICleanUp
and Cleaner
provide a means to clean up / reset the properties of an entity in a consistent manner, and / or return an entity to a consistent state.
The IUniqueKey
and UniqueKey
provide a means to define a unique key (composed of one or more properties) for an entity. This allows the UniqueKey
for an entity to be accessed in a consistent manner that is leveraged by other capabilities within the Beef framework.
The PagingArgs
, IPagingResult
and PagingResult
represents the key capabilities to support paging requests and corresponding response in a consistent manner.
Provides the key capabilities to enable the rich reference data functionality central to Beef. This capability is further described here.
Provides the Web API Agent capabilities to standardize the invocation of APIs. The WebApiAgentBase
is essential to enable.