BridgingIT.DevKit.Common.Abstractions 9.0.2-preview.49

This is a prerelease version of BridgingIT.DevKit.Common.Abstractions.
There is a newer version of this package available.
See the version list below for details.
dotnet add package BridgingIT.DevKit.Common.Abstractions --version 9.0.2-preview.49
                    
NuGet\Install-Package BridgingIT.DevKit.Common.Abstractions -Version 9.0.2-preview.49
                    
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="BridgingIT.DevKit.Common.Abstractions" Version="9.0.2-preview.49" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BridgingIT.DevKit.Common.Abstractions" Version="9.0.2-preview.49" />
                    
Directory.Packages.props
<PackageReference Include="BridgingIT.DevKit.Common.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BridgingIT.DevKit.Common.Abstractions --version 9.0.2-preview.49
                    
#r "nuget: BridgingIT.DevKit.Common.Abstractions, 9.0.2-preview.49"
                    
#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.
#addin nuget:?package=BridgingIT.DevKit.Common.Abstractions&version=9.0.2-preview.49&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BridgingIT.DevKit.Common.Abstractions&version=9.0.2-preview.49&prerelease
                    
Install as a Cake Tool

bITDevKit

Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles.

Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

This repository includes the complete source code for the bITDevKit, along with a variety of sample applications located in the ./examples folder within the solution. These samples serve as practical demonstrations of how to leverage the capabilities of the bITDevKit in real-world scenarios. All components are available as nuget packages.

For the latest updates and release notes, please refer to the RELEASES.

Join us in advancing the world of software development with the bITDevKit!


Result.cs Overview

The Result class encapsulates the outcome of an operation, promoting an expressive and error-tolerant way to handle success and failure states.

The Result class is a central component designed to encapsulate the outcome of an operation, providing a way to represent both successful and failed operations. This class promotes a more expressive and error-tolerant approach to handling operation results, encouraging the explicit declaration of success or failure states.

Returning a Result

To return a Result from a method, you typically define the method to return Result or Result<T>, where T is the type of the value returned in case of success. Here is an example method returning a Result:

public Result PerformOperation()
{
    // Your logic here
    
    if (success)
    {
        return Result.Success();
    }
    else
    {
        return Result.Failure(new Error("Operation Failed"));
    }
}

Handling a Result

When you receive a Result from a method, you can handle it by checking its success or failure state. Here's an example:

var result = PerformOperation();

if (result.IsSuccess)
{
    // Handle success
}
else
{
    // Handle failure
    var error = result.Error;
    Console.WriteLine(error.Message);
}

Using Typed Results

Sometimes, you may want to return a result with a value. This is where Result<T> comes in handy:

public Result<int> CalculateSum(int a, int b)
{
    if (a < 0 || b < 0)
    {
        return Result.Failure<int>(new Error("Inputs must be non-negative"));
    }

    return Result.Success(a + b);
}

Handling a Result<T> involves extracting the value if the operation was successful:

var result = CalculateSum(5, 10);

if (result.IsSuccess)
{
    int sum = result.Value;
    Console.WriteLine($"Sum: {sum}");
}
else
{
    Console.WriteLine(result.Error.Message);
}

Typed Errors

Typed errors provide a more specific and structured way to handle different error scenarios. For example, the EntityNotFoundResultError class can be used to represent an error where an entity is not found:

EntityNotFoundResultError.cs:
public class EntityNotFoundResultError : Error
{
    public EntityNotFoundResultError(string entityName, object key)
        : base($"Entity '{entityName}' with key '{key}' was not found.")
    {
    }
}

You can return this typed error as follows:

public Result GetEntity(int id)
{
    var entity = repository.FindById(id);

    if (entity == null)
    {
        return Result.Failure(new EntityNotFoundResultError("EntityName", id));
    }

    return Result.Success(entity);
}

When handling the result, you can check if the error is of a specific type:

var result = GetEntity(1);

if (result.IsSuccess)
{
    // Handle success
}
else if (result.Error is EntityNotFoundResultError)
{
    var error = (EntityNotFoundResultError)result.Error;
    Console.WriteLine(error.Message);
}
else
{
    // Handle other errors
}

Other available typed errors are:

By using typed errors, you can create more expressive and manageable error handling in your application.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (14)

Showing the top 5 NuGet packages that depend on BridgingIT.DevKit.Common.Abstractions:

Package Downloads
BridgingIT.DevKit.Common.Utilities

BridgingIT DevKit: Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles. Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

BridgingIT.DevKit.Common.Serialization

BridgingIT DevKit: Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles. Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

BridgingIT.DevKit.Domain

BridgingIT DevKit: Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles. Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

BridgingIT.DevKit.Application.Storage

BridgingIT DevKit: Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles. Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

BridgingIT.DevKit.Application.Messaging

BridgingIT DevKit: Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles. Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.3 17 7/4/2025
9.0.3-preview.0.1 38 7/3/2025
9.0.2 42 7/2/2025
9.0.2-preview.55 40 7/1/2025
9.0.2-preview.54 84 6/26/2025
9.0.2-preview.53 84 6/26/2025
9.0.2-preview.51 85 6/26/2025
9.0.2-preview.50 85 6/26/2025
9.0.2-preview.49 89 6/25/2025
9.0.2-preview.47 117 6/25/2025
9.0.2-preview.46 103 6/25/2025
9.0.2-preview.45 117 6/25/2025
9.0.2-preview.44 147 6/25/2025
9.0.2-preview.43 143 6/24/2025
9.0.2-preview.42 139 6/24/2025
9.0.2-preview.41 124 6/23/2025
9.0.2-preview.39 42 6/21/2025
9.0.2-preview.38 74 6/20/2025
9.0.2-preview.37 88 6/20/2025
9.0.2-preview.36 112 6/17/2025
9.0.2-preview.35 125 6/14/2025
9.0.2-preview.34 254 6/12/2025
9.0.2-preview.33 258 6/11/2025
9.0.2-preview.32 271 6/11/2025
9.0.2-preview.31 257 6/11/2025
9.0.2-preview.28 260 6/11/2025
9.0.2-preview.25 254 6/11/2025
9.0.2-preview.24 260 6/11/2025
9.0.2-preview.23 257 6/11/2025
9.0.2-preview.22 255 6/11/2025
9.0.2-preview.21 281 6/10/2025
9.0.2-preview.20 262 6/10/2025
9.0.2-preview.19 254 6/10/2025
9.0.2-preview.18 255 6/9/2025
9.0.2-preview.16 211 6/9/2025
9.0.2-preview.14 43 6/7/2025
9.0.2-preview.13 43 6/6/2025
9.0.2-preview.12 43 6/6/2025
9.0.2-preview.5 62 6/6/2025
9.0.2-preview.3 126 6/4/2025
9.0.2-preview.2 121 6/4/2025
9.0.2-preview.1 111 6/4/2025
9.0.1-preview.0.335 183 6/2/2025
9.0.1-preview.0.333 123 6/2/2025
9.0.1-preview.0.332 115 6/1/2025
9.0.1-preview.0.331 115 6/1/2025
9.0.1-preview.0.329 39 5/30/2025
9.0.1-preview.0.326 51 5/30/2025
9.0.1-preview.0.324 40 5/30/2025
9.0.1-preview.0.323 45 5/30/2025
9.0.1-preview.0.321 68 5/30/2025
9.0.1-preview.0.319 50 5/30/2025
9.0.1-preview.0.318 61 5/30/2025
9.0.1-preview.0.317 67 5/30/2025
9.0.1-preview.0.316 71 5/30/2025
9.0.1-preview.0.315 91 5/30/2025
9.0.1-preview.0.314 74 5/30/2025
9.0.1-preview.0.312 79 5/30/2025
9.0.1-preview.0.309 115 5/28/2025
9.0.1-preview.0.302 116 5/21/2025
9.0.1-preview.0.301 154 5/21/2025
9.0.1-preview.0.300 116 5/21/2025
9.0.1-preview.0.299 122 5/21/2025
9.0.1-preview.0.297 171 5/21/2025
9.0.1-preview.0.296 126 6/4/2025
9.0.1-preview.0.295 112 5/21/2025
9.0.1-preview.0.294 119 5/21/2025
9.0.1-preview.0.293 114 5/21/2025
9.0.1-preview.0.290 121 5/19/2025
9.0.1-preview.0.287 130 5/19/2025
9.0.1-preview.0.286 216 5/15/2025
9.0.1-preview.0.285 206 5/13/2025
9.0.1-preview.0.279 197 5/13/2025
9.0.1-preview.0.278 209 5/13/2025
9.0.1-preview.0.277 206 5/13/2025
9.0.1-preview.0.276 260 5/13/2025
9.0.1-preview.0.274 122 5/19/2025
9.0.1-preview.0.272 107 5/11/2025
9.0.1-preview.0.271 107 5/11/2025
9.0.1-preview.0.270 87 5/9/2025
9.0.1-preview.0.267 113 5/7/2025
9.0.1-preview.0.266 114 5/7/2025
9.0.1-preview.0.265 120 5/6/2025
9.0.1-preview.0.264 167 5/6/2025
9.0.1-preview.0.263 117 5/6/2025
9.0.1-preview.0.262 120 5/6/2025
9.0.1-preview.0.261 123 5/6/2025
9.0.1-preview.0.258 475 5/6/2025
9.0.1-preview.0.255 86 5/9/2025
9.0.1-preview.0.254 122 5/8/2025
9.0.1-preview.0.253 116 5/8/2025
9.0.1-preview.0.252 119 5/8/2025
9.0.1-preview.0.251 115 5/8/2025
9.0.1-preview.0.250 125 5/7/2025
9.0.1-preview.0.247 133 5/7/2025
9.0.1-preview.0.246 116 5/7/2025
9.0.1-preview.0.244 152 4/17/2025
9.0.1-preview.0.243 227 4/15/2025
9.0.1-preview.0.242 157 4/15/2025
9.0.1-preview.0.241 154 4/15/2025
9.0.1-preview.0.239 155 4/15/2025
9.0.1-preview.0.238 256 4/15/2025
9.0.1-preview.0.237 213 4/13/2025
9.0.1-preview.0.236 150 4/10/2025
9.0.1-preview.0.235 131 4/10/2025
9.0.1-preview.0.234 144 4/10/2025
9.0.1-preview.0.233 166 4/9/2025
9.0.1-preview.0.232 129 4/9/2025
9.0.1-preview.0.231 127 4/9/2025
9.0.1-preview.0.230 183 4/7/2025
9.0.1-preview.0.229 142 4/7/2025
9.0.1-preview.0.228 145 4/7/2025
9.0.1-preview.0.227 136 4/4/2025
9.0.1-preview.0.226 132 4/3/2025
9.0.1-preview.0.220 167 4/2/2025
9.0.1-preview.0.219 120 4/1/2025
9.0.1-preview.0.218 119 4/1/2025
9.0.1-preview.0.217 184 4/1/2025
9.0.1-preview.0.215 145 4/1/2025
9.0.1-preview.0.214 126 4/1/2025
9.0.1-preview.0.213 145 4/1/2025
9.0.1-preview.0.212 152 4/1/2025
9.0.1-preview.0.211 124 4/1/2025
9.0.1-preview.0.210 129 4/1/2025
9.0.1-preview.0.209 142 3/31/2025
9.0.1-preview.0.208 145 3/31/2025
9.0.1-preview.0.206 128 3/31/2025
9.0.1-preview.0.205 137 3/31/2025
9.0.1-preview.0.204 133 3/31/2025
9.0.1-preview.0.202 125 3/31/2025
9.0.1-preview.0.199 63 3/29/2025
9.0.1-preview.0.198 101 3/28/2025
9.0.1-preview.0.196 108 3/28/2025
9.0.1-preview.0.193 101 3/27/2025
9.0.1-preview.0.189 125 3/26/2025
9.0.1-preview.0.188 454 3/25/2025
9.0.1-preview.0.187 464 3/24/2025
9.0.1-preview.0.186 452 3/24/2025
9.0.1-preview.0.185 453 3/24/2025
9.0.1-preview.0.184 455 3/24/2025
9.0.1-preview.0.183 451 3/24/2025
9.0.1-preview.0.182 62 3/21/2025
9.0.1-preview.0.180 112 3/21/2025
9.0.1-preview.0.179 122 3/21/2025
9.0.1-preview.0.178 118 3/21/2025
9.0.1-preview.0.175 120 3/20/2025
9.0.1-preview.0.174 121 3/19/2025
9.0.1-preview.0.173 135 3/19/2025
9.0.1-preview.0.172 282 3/19/2025
9.0.1-preview.0.171 118 3/19/2025
9.0.1-preview.0.170 118 3/18/2025
9.0.1-preview.0.165 118 3/18/2025
9.0.1-preview.0.162 127 3/17/2025
9.0.1-preview.0.160 120 3/17/2025
9.0.1-preview.0.152 100 3/14/2025
9.0.1-preview.0.148 141 3/13/2025
9.0.1-preview.0.147 123 3/13/2025
9.0.1-preview.0.146 124 3/12/2025
9.0.1-preview.0.145 132 3/12/2025
9.0.1-preview.0.141 129 3/12/2025
9.0.1-preview.0.140 170 3/10/2025
9.0.1-preview.0.139 126 3/10/2025
9.0.1-preview.0.138 141 3/10/2025
9.0.1-preview.0.137 120 3/8/2025
9.0.1-preview.0.135 136 3/8/2025
9.0.1-preview.0.134 175 3/7/2025
9.0.1-preview.0.133 170 3/6/2025
9.0.1-preview.0.132 166 3/6/2025
9.0.1-preview.0.130 165 3/6/2025
9.0.1-preview.0.129 219 3/6/2025
9.0.1-preview.0.128 170 3/6/2025
9.0.1-preview.0.127 176 3/6/2025
9.0.1-preview.0.125 184 3/4/2025
9.0.1-preview.0.119 79 2/28/2025
9.0.1-preview.0.118 62 2/28/2025
9.0.1-preview.0.116 68 2/28/2025
9.0.1-preview.0.112 57 2/27/2025
9.0.1-preview.0.111 66 2/27/2025
9.0.1-preview.0.110 114 2/26/2025
9.0.1-preview.0.107 79 2/26/2025
9.0.1-preview.0.106 70 2/26/2025
9.0.1-preview.0.105 67 2/26/2025
9.0.1-preview.0.104 72 2/26/2025
9.0.1-preview.0.103 92 2/26/2025
9.0.1-preview.0.102 88 2/26/2025
9.0.1-preview.0.100 57 2/26/2025
9.0.1-preview.0.99 100 2/25/2025
9.0.1-preview.0.97 69 2/25/2025
9.0.1-preview.0.96 62 2/25/2025
9.0.1-preview.0.94 64 2/24/2025
9.0.1-preview.0.93 93 2/24/2025
9.0.1-preview.0.92 63 2/21/2025
9.0.1-preview.0.91 56 2/21/2025
9.0.1-preview.0.88 64 2/19/2025
9.0.1-preview.0.87 247 2/18/2025
9.0.1-preview.0.85 266 2/18/2025
9.0.1-preview.0.84 205 2/17/2025
9.0.1-preview.0.82 165 2/17/2025
9.0.1-preview.0.79 174 2/14/2025
9.0.1-preview.0.78 194 2/14/2025
9.0.1-preview.0.77 168 2/14/2025
9.0.1-preview.0.76 206 2/14/2025
9.0.1-preview.0.73 197 2/14/2025
9.0.1-preview.0.71 142 2/14/2025
9.0.1-preview.0.70 188 2/13/2025
9.0.1-preview.0.69 180 2/13/2025
9.0.1-preview.0.67 187 2/13/2025
9.0.1-preview.0.62 172 2/11/2025
9.0.1-preview.0.58 79 2/7/2025
9.0.1-preview.0.56 71 2/7/2025
9.0.1-preview.0.55 57 2/6/2025
9.0.1-preview.0.54 62 2/6/2025
9.0.1-preview.0.53 56 2/6/2025
9.0.1-preview.0.52 59 2/6/2025
9.0.1-preview.0.50 76 2/6/2025
9.0.1-preview.0.49 118 2/6/2025
9.0.1-preview.0.47 59 2/6/2025
9.0.1-preview.0.45 65 2/6/2025
9.0.1-preview.0.43 66 2/5/2025
9.0.1-preview.0.42 64 2/5/2025
9.0.1-preview.0.41 67 2/5/2025
9.0.1-preview.0.35 67 2/4/2025
9.0.1-preview.0.20 64 1/30/2025
9.0.1-preview.0.19 57 1/30/2025
9.0.1-preview.0.18 60 1/30/2025
9.0.1-preview.0.14 59 1/30/2025
9.0.1-preview.0.13 67 1/30/2025
9.0.1-preview.0.11 55 1/29/2025
9.0.1-preview.0.10 54 1/29/2025
9.0.1-preview.0.9 60 1/27/2025
9.0.1-preview.0.2 116 1/27/2025
3.0.5-preview.0.2 129 4/1/2025
3.0.5-preview.0.1 81 2/11/2025
3.0.4 500 1/25/2025
3.0.4-preview.0.38 68 1/25/2025
3.0.4-preview.0.37 106 12/6/2024
3.0.4-preview.0.36 199 12/5/2024
3.0.4-preview.0.34 70 12/5/2024
3.0.4-preview.0.32 70 12/4/2024
3.0.4-preview.0.31 87 11/25/2024
3.0.4-preview.0.30 67 11/25/2024
3.0.4-preview.0.29 61 11/21/2024
3.0.4-preview.0.28 119 11/19/2024
3.0.4-preview.0.27 62 11/19/2024
3.0.4-preview.0.23 64 11/19/2024
3.0.4-preview.0.21 54 11/19/2024
3.0.4-preview.0.20 59 11/18/2024
3.0.4-preview.0.19 69 11/18/2024
3.0.4-preview.0.18 55 11/18/2024
3.0.4-preview.0.17 57 11/18/2024
3.0.4-preview.0.16 63 11/15/2024
3.0.4-preview.0.15 57 11/15/2024
3.0.4-preview.0.14 76 11/2/2024
3.0.4-preview.0.13 72 10/29/2024
3.0.4-preview.0.12 63 10/29/2024
3.0.4-preview.0.8 69 10/29/2024
3.0.4-preview.0.7 70 10/29/2024
3.0.4-preview.0.6 61 10/24/2024
3.0.4-preview.0.5 68 10/23/2024
3.0.4-preview.0.4 60 10/23/2024
3.0.4-preview.0.3 62 10/23/2024
3.0.4-preview.0.2 66 10/23/2024
3.0.4-preview.0.1 203 10/16/2024
3.0.3 390 10/11/2024
3.0.3-preview.0.56 78 10/10/2024
3.0.3-preview.0.55 70 10/10/2024
3.0.3-preview.0.54 76 10/10/2024
3.0.3-preview.0.50 71 10/10/2024
3.0.3-preview.0.49 87 10/9/2024
3.0.3-preview.0.44 92 10/8/2024
3.0.3-preview.0.43 68 10/8/2024
3.0.3-preview.0.42 69 10/7/2024
3.0.3-preview.0.41 72 10/7/2024
3.0.3-preview.0.40 104 10/1/2024
3.0.3-preview.0.39 72 10/1/2024
3.0.3-preview.0.38 68 10/1/2024
3.0.3-preview.0.36 73 9/30/2024
3.0.3-preview.0.35 88 9/26/2024
3.0.3-preview.0.34 82 9/26/2024
3.0.3-preview.0.33 69 9/26/2024
3.0.3-preview.0.32 99 9/24/2024
3.0.3-preview.0.31 757 9/10/2024
3.0.3-preview.0.30 67 9/9/2024
3.0.3-preview.0.29 63 9/9/2024
3.0.3-preview.0.28 55 9/8/2024
3.0.3-preview.0.27 77 9/5/2024
3.0.3-preview.0.26 75 9/3/2024
3.0.3-preview.0.25 64 9/3/2024
3.0.3-preview.0.24 78 9/3/2024
3.0.3-preview.0.23 88 8/21/2024
3.0.3-preview.0.22 58 7/29/2024
3.0.3-preview.0.21 76 7/25/2024
3.0.3-preview.0.18 78 7/12/2024
3.0.3-preview.0.17 72 7/12/2024
3.0.3-preview.0.16 61 7/12/2024
3.0.3-preview.0.15 65 7/5/2024
3.0.3-preview.0.14 131 6/24/2024
3.0.3-preview.0.13 92 6/23/2024
3.0.3-preview.0.12 84 6/21/2024
3.0.3-preview.0.11 83 6/20/2024
3.0.3-preview.0.9 365 5/27/2024
3.0.3-preview.0.8 76 5/27/2024
3.0.3-preview.0.7 104 5/17/2024
3.0.3-preview.0.6 80 5/14/2024
3.0.3-preview.0.5 305 5/8/2024
3.0.3-preview.0.3 101 5/6/2024
3.0.3-preview.0.1 90 4/25/2024
3.0.2 1,334 4/25/2024
3.0.2-preview.0.4 98 4/25/2024
3.0.2-preview.0.3 152 4/25/2024
3.0.2-preview.0.2 101 4/25/2024
3.0.2-preview.0.1 78 4/25/2024
3.0.1 439 4/25/2024
3.0.1-preview.0.10 86 4/24/2024
3.0.1-preview.0.9 189 4/19/2024
3.0.1-preview.0.8 71 4/24/2024
3.0.1-preview.0.7 139 4/24/2024

## Release 3.0.1 [25.04.24]

- [N] Initial release

-----

- [N] New
- [M] Modified
- [B] Breaking