Tildom.Core
6.0.3
Prefix Reserved
See the version list below for details.
dotnet add package Tildom.Core --version 6.0.3
NuGet\Install-Package Tildom.Core -Version 6.0.3
<PackageReference Include="Tildom.Core" Version="6.0.3" />
paket add Tildom.Core --version 6.0.3
#r "nuget: Tildom.Core, 6.0.3"
// Install Tildom.Core as a Cake Addin #addin nuget:?package=Tildom.Core&version=6.0.3 // Install Tildom.Core as a Cake Tool #tool nuget:?package=Tildom.Core&version=6.0.3
Welcome to Tildom.Core
Introduction
Tildom.Core is a C# library offering the core types and methods for other Tildom libraries. Currently it has the definition and implementation of IOperationResult<T>
. IOperationResutl<T>
is designed to streamline handling operation results in .NET 6.0+ applications. It provides a robust way to encapsulate success, failure, and optional values, ensuring clear and consistent handling of various operation outcomes.
An Important Note on Versioning
Tildom.Core and most other Tildom domain libraries are versioned following their minimum-supported .NET version as the primary version number. In the case of 6.0.0, this means the library supports .NET 6 and onwards. It is always a LTS version of the .NET, such as 6, 8 and so on. The secondary version number is the major version of the library itself (feature flag). The third version number is the minor version of the library itself (fix flag).
If you are using these libraries, you can easily tell which version to use based on the .NET version you are targeting. For example, if you are using .NET 6, you should use Tildom.Core 6.0.0. If you are on Tildom.Core 6.1.20 and 6.2.1 is available, you should be careful with updating since breaking changes could have been introduced.
When Is A .NET Version Deprecated
A shorter cycle is applied to this process compared to Microsoft's LTS support schedule. Libraries are hopefully updated to a new .NET version when a STS version is released. For instance, currently .NET 8.0 has just been released, in which case, the libraries would support the previous LTS version = .NET 6.0. When .NET 9.0 is released in 2024, the libraries would be updated to support .NET 8.0. But when in 2025, another LTS version is released, the libraries would still support .NET 8.0.
Features
- Generic Operation Results: Handle success and failure scenarios generically using
SuccessResult<T>
andErrorResult<T>
. - Optional Values: Utilize
Maybe<T>
andLazyMaybe<T>
for scenarios where values may or may not be present. - Asynchronous Support: Includes async-compatible methods with comprehensive support for cancellation tokens.
- Extensive Logging: Integrated logging capabilities to track and audit operation outcomes.
Installation
To install the OperationResults library, use the following NuGet command:
Install-Package Tildom.Core
Or .NET CLI
dotnet add package OperationResults
Usage
Basic Usage
Here's a quick example of how to use SuccessResult<T>
:
var success = new SuccessResult<int>(42);
success.Match(
onSuccess: value => Console.WriteLine($"Success with value: {value}"),
onError: (ex, maybe) => Console.WriteLine("An error occurred.")
);
Handling Errors
Example using ErrorResult<T>
:
var errorResult = new ErrorResult<string>(new Exception("Error occurred"));
errorResult.Match(
onSuccess: value => Console.WriteLine($"Unexpected success: {value}"),
onError: (ex, maybe) => Console.WriteLine($"Error: {ex.Message}. ")
);
Contributing
We welcome contributions! If you would like to help improve the library, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Write your code and add tests.
- Submit a pull request with a clear description of your changes.
Please read our Contributing Guidelines for more information.
License
This library is licensed under the MIT License. See the LICENSE file for details.
Support
If you have any questions or need help, please open an issue in the GitHub repository.
Acknowledgements
Special thanks to all the contributors who have participated in this project.
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. |
-
net6.0
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Tildom.Core:
Package | Downloads |
---|---|
Tildom.Utilities
Tildom.Utilities is a library that offers utility types and methods for .NET and C#. |
|
Tildom.Libraries.MongoDb
Tildom.Libraries.MongoDb offers an abstraction layer on top of the official MongoDb Driver. |
|
Tildom.Services
Tildom.Services is a C# library offering some convenient service and wrapper types. |
|
Tildom.Libraries.Invenias
Tildom.Libraries.Invenias is a C#/Dotnet developer's library for Invenias's web APIs. |
GitHub repositories
This package is not used by any popular GitHub repositories.