Skip to content

Latest commit

 

History

History
 
 

Beef.Core

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Beef.Core

This is the foundational Assembly that provides the core capabilities of Beef. The 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

DataContextScope

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.


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 where ever end user texts are intended to be output.


Factory

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.


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.Business namespace

This provides classes used specifically by the primary domain business logic (see Solution Structure).


Beef.Caching namespace

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.


Beef.CodeGen namespace

The CodeGenerator provides the core code generation capabilities used by all the tooling.


Beef.Diagnostics namespace

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.


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.


Events namespace

Provides the basic infrastructure support to support a basic event-driven architecture, through Event and EventData.


Executors namespace

Provide for Executor, and corresponding Trigger orchestration, to standardise the processing of long-running, batch-style, operations.


Json namespace

Additional capabilities to process JSON, such as JsonEntityMerge and JsonPropertyFilter.


Mapper namespace

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.


Net namespace

Additional HTTP capabilities, specifically HttpMultiPartRequestReader and HttpMultiPartResponseReader.


RefData namespace

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


Validation namespace

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


WebApi namespace

Provides the service agent capabilities to standardize the invocation of APIs. The WebApiServiceAgentBase is essential to enable.