This is the foundational Assembly that provides the core capabilities of Beef. The 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 DataContextScope
manages the automatic creation and lifetime of the likes of connections across multiple invocations within the context of executing (see ExecutionContext
) a request. This enables the likes of database connections, contexts, or other expensive objects to be shared.
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 where ever end user texts are intended to be output.
The Factory
is used within Beef to create concrete instances from interfaces to enable the likes for mocking for testing. There are additional capabilities within to simplify configuration for primary runtime classes where the substitution default naming pattern is followed.
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.
This provides classes used specifically by the primary domain business logic (see Solution Structure
).
This provides for basic in-memory Caching capabilities (see CacheCoreBase
), and corresponding Policy to flush and/or refresh as required (managed by CachePolicyManager
).
The advantages of using memory caching is clearly performance; although, caution is required where the volume of data being cached is significant. Equally, where data must be expired at the same time across caches in the likes of a server farm. Alternates to consider are the likes of Redis.
The CodeGenerator
provides the core code generation capabilities used by all the tooling.
Provides additional diagnostics capabilities leveraged by Beef; primarily the Logger
which enables implementation agnostic logging to be leveraged. Generally at startup the actual logging capabaility is bound (bind) to the Logger
so that logged messages are routed and output as required.
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
forHasUniqueKey
andUniqueKey
. - 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 basic infrastructure support to support a basic event-driven architecture, through Event
and EventData
.
Provide for Executor
, and corresponding Trigger
orchestration, to standardise the processing of long-running, batch-style, operations.
Additional capabilities to process JSON, such as JsonEntityMerge
and JsonPropertyFilter
.
Provides the base, and entity-to-entity, class and property mapping capability central to the data layer capabilities within Beef. The IPropertyMapperConverter
enables property Type
conversion.
The EntityMapper
provides the entity-to-entity mapping capability / implementation.
Additional HTTP
capabilities, specifically HttpMultiPartRequestReader
and HttpMultiPartResponseReader
.
Provides the key capabilities to enable the rich reference data functionality central to Beef. This capability is further described here.
Provides the key capabilities to enable the rich validation functionality central to Beef. This capability is further described here.
Provides the service agent capabilities to standardize the invocation of APIs. The WebApiServiceAgentBase
is essential to enable.