Skip to content

Latest commit

 

History

History
 
 

Beef.Abstractions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Beef.Abstractions

This is the primary Assembly that provides the core fundamental capabilities of Beef. The key classes and/or underlying NameSpaces are desribed.


Beef (root) namespace

This is the base set of capabilities (classes) available within Beef; the following are of specific note:


ExecutionContext

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.


IBusinessException

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

LText and TextProvider

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.


InvokerBase

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.


Beef.Entities namespace

Provides the key capabilities to enable the rich business entity functionality central to Beef.

EntityBasicBase

The EntityBasicBase provides the basic entity capabilities:

  • Standardised SetValue methods to enable capabilities such as StringTrim, StringTransform, DateTimeTransform.
  • Property immutability support; i.e. value can not be changed once set.
  • Entity readonly support (MakeReadOnly and IsReadOnly).
  • Entity changed support (IsChanged and AcceptChanges).
  • Implements INotifyPropertyChanged for PropertyChanged event.

EntityBase

The EntityBase provides the rich entity capabilities (inherits from EntityBasicBase):

Note: The entity code-generation will ensure that the EntityBase and corresponding capabilities, specifically the SetValue, are implemented correctly.


EntityBaseCollection

The EntityBaseCollection encapsulates an ObservableCollection<T> to provide the base class for all entity collections enabling a consistent and rich experience.


EntityCollectionResult

The EntityCollectionResult provides a standardised mechanism to manage a collection Result, that may also contain corresponding Paging details where required.


MessageItem and MessageItemCollection

The MessageItem and MessageItemCollection provide a means to manage messages (Type, Text and optional Property) used for the likes of validation error messages, etc.


ICleanUp and Cleaner

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.


IUniqueKey and UniqueKey

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.


Paging, IPagingResult and PagingResult

The PagingArgs, IPagingResult and PagingResult represents the key capabilities to support paging requests and corresponding response in a consistent manner.


RefData namespace

Provides the key capabilities to enable the rich reference data functionality central to Beef. This capability is further described here.


WebApi namespace

Provides the Web API Agent capabilities to standardize the invocation of APIs. The WebApiAgentBase is essential to enable.