TheOmenDen.Shared
2022.8.27.345
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TheOmenDen.Shared --version 2022.8.27.345
NuGet\Install-Package TheOmenDen.Shared -Version 2022.8.27.345
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TheOmenDen.Shared" Version="2022.8.27.345" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TheOmenDen.Shared --version 2022.8.27.345
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TheOmenDen.Shared, 2022.8.27.345"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TheOmenDen.Shared as a Cake Addin #addin nuget:?package=TheOmenDen.Shared&version=2022.8.27.345 // Install TheOmenDen.Shared as a Cake Tool #tool nuget:?package=TheOmenDen.Shared&version=2022.8.27.345
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
The Omen Den Shared Library
This is just a grouping of common classes that are used within every application that The Omen Den aims to provide as a company, and is free to modify, redistribute, and use elsewhere
Especially since this library is sure to not be unique to us.
Attributions for credits on each release are defined below
<br /><br />
Goals that we aim for:
- Relevant extensions across The Omen Den's software applications
- Exception calling, and custom exceptions
- Pooling extensions for StringBuilder and Arrays
- Hopefully working towards far less overhead than constantly newing these types up
- In the case of arrays, adding "slicing" SubArray functionality
- Custom Enumerations
- Providing ways to grade exceptions via gravity
- Providing ways to use "smarter" enumerations for differing control flow
- Provides two structs
Conditions and Consequences
that can be chained together against theEnumerationBase
implementations - Inspired by:
- Provides simple LINQ methods for
ReadOnlySpan<T>
- Base Record types for
QueryStrings
- AsyncLazyInitializer type sourced from: Microsoft Dev Blogs
- Extensions on the
Type Type
to allow for easier retrieval of ancestors - Provides
Progress Bars
that can also be threadsafe, as well as a simple progress indicator.- Gives the caller the ability to specify a change in the
ConsoleColor
with any one of the provided colors. - Provides a relatively smooth, and rate-adjustable animation on the progress indicator
- Gives the caller the ability to specify a change in the
- Provides
Guard
methods that can be used to help control the flow and validtion of models and creation of various components in an application domain.
Async Stream Handling Features
- Provided in the
AsynchronousStreamOutcome
set of extensions are a few methods for capturingOperationOutcome
during the iterations of anIAsyncEnumerable<T>
- The
T
in question must implement ourIEntity
interface. - We aim to work solely with asynchronous iterations provided by an
await foreach()
pattern - We also aim to provide a simple, and easy to interpret API for further processing and alignment by avoiding an underlying
try...catch
within the Async Iterator.
- The
- Our current implementation allows for the simplicity of just providing a long running delegate of an individual operation.
Func<in T, in CancellationToken, out ValueTask<OperationOutcome>>
- This guarantees that the underlying operation is asynchronous
- This also ensures that the operation returns an
OperationOutcome
object
- With this provided, our intent on design is twofold -
- Firstly We remove the basis for throwing an exception over the stream.
- Secondly We allow for individual failures to occur during the stream.
- With this approach, we aim to allow for multiple failures to occur during the stream, while maintaining a consistent reporting behavior to allow for a more streamlined client experience.
- We also aim for the
Tuple<T,OperationOutcome>
coupling to be a launching strategy for further processing.
EnumerationBase
- These
Record Types
are implemented as such:EnumerationBase<TKey>
- Similar to the standard Enumeration
Enum
type that you will see inC#
but provides the ability to work with Condtions (When) and Consequences (Then) allowing for the expansion of logic ontop of Enumerations. - We provide a way to customize this further by using
EnumrationBase<TKey, TEnumeration>
to define a customized "backing field" for your own design. - We also provide guards, and relevant exceptions to assist in runtime "Early Swift Failure" practices.
- Similar to the standard Enumeration
EnumerationFlagBase<TKey>
- This record allows for your enumerations to be extended to have a similar functionality as working with bit flags on your standard
C#
enumerations. - This is further enhanced by the use of our
Condtions (When) ... Consequences (Then)
pattern - allowing for more robust and well defined logic. - Strictly enforced by makign the definition of the enum require an integer backing field using powers of two (2<sup>n</sup>)
- 2,4,8,16... 2<sup>n</sup>
- This record allows for your enumerations to be extended to have a similar functionality as working with bit flags on your standard
Guards
- We have create a
Guard
partial class system- Our aim/intention with this is to allow for a "fail early" strategy at your domain's edge.
- We encourage you NOT to use these classes within your business logic/application domain since that seems to be an anti-pattern.
- There are also differing typed exceptions that are thrown per condition, as well as provided exception message templates.
- If you desire to define your own custom Guard - You would want to work with the
Guard.FromCondition
method. This allows for the passing of a delegate that has a boolean result, and anException
object as an outcome.- e.g.
Guard.FromCondition(Func<Boolean>, Exception exception)
- e.g.
TODOs:
- Provide better source generation for our generic implementations
- Provide clearer, and more accessible documentation
- Add
.NET 7
and.NET Standard
build targets. - General clean-up, and optimizations
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- System.Linq.Async (>= 6.0.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on TheOmenDen.Shared:
Package | Downloads |
---|---|
TheOmenDen.Shared.Logging
A collection of logging utilities that are used throughout The Omen Den's applications. Also provides an eventtype enricher for Serilog |
|
TheOmenDen.Shared.Interfaces
This package contains the interfaces that can used for various implementations, and some of the models behind them for Tenancy and User based applications. |
|
TheOmenDen.Shared.Services
A collection of the service implementations used throughout the various apps that The Omen Den develops. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2023.11.27.49 | 1,204 | 11/27/2023 |
2023.3.25.112 | 3,170 | 3/25/2023 |
2023.3.17.2238 | 389 | 3/18/2023 |
2023.1.15.141 | 606 | 1/15/2023 |
2022.11.13.2149 | 1,218 | 11/14/2022 |
2022.10.8.41 | 2,435 | 10/8/2022 |
2022.9.19.1408 | 993 | 9/19/2022 |
2022.8.27.345 | 697 | 8/27/2022 |
2022.8.13.1752 | 543 | 8/13/2022 |
2022.7.26.331 | 828 | 7/26/2022 |
2022.7.19.110 | 626 | 7/19/2022 |
2022.7.13.1515 | 546 | 7/13/2022 |
2022.7.11.1017 | 517 | 7/11/2022 |
Add guard classes, add enumeration record types