BridgingIT.DevKit.Common.Abstractions 3.0.3-preview.0.41

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 3.0.3-preview.0.41
                    
NuGet\Install-Package BridgingIT.DevKit.Common.Abstractions -Version 3.0.3-preview.0.41
                    
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="3.0.3-preview.0.41" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BridgingIT.DevKit.Common.Abstractions" Version="3.0.3-preview.0.41" />
                    
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 3.0.3-preview.0.41
                    
#r "nuget: BridgingIT.DevKit.Common.Abstractions, 3.0.3-preview.0.41"
                    
#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.
#:package BridgingIT.DevKit.Common.Abstractions@3.0.3-preview.0.41
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BridgingIT.DevKit.Common.Abstractions&version=3.0.3-preview.0.41&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BridgingIT.DevKit.Common.Abstractions&version=3.0.3-preview.0.41&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 net8.0 is compatible.  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.  net9.0 was computed.  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.8 162 6 days ago
9.0.7 166 8 days ago
9.0.6 167 8 days ago
9.0.6-preview.0.9 110 a month ago
9.0.6-preview.0.6 119 a month ago
9.0.6-preview.0.5 114 a month ago
9.0.6-preview.0.3 75 a month ago
9.0.5 529 a month ago
9.0.5-preview.0.1 127 a month ago
9.0.4 413 a month ago
9.0.4-preview.0.4 200 a month ago
9.0.4-preview.0.3 166 a month ago
9.0.4-preview.0.2 150 a month ago
9.0.4-preview.0.1 119 a month ago
9.0.3 354 a month ago
9.0.3-preview.0.1 125 a month ago
9.0.2 363 a month ago
9.0.2-preview.55 131 a month ago
9.0.2-preview.54 153 2 months ago
9.0.2-preview.53 119 2 months ago
9.0.2-preview.51 117 2 months ago
9.0.2-preview.50 118 2 months ago
9.0.2-preview.49 134 2 months ago
9.0.2-preview.47 130 2 months ago
9.0.2-preview.46 115 2 months ago
9.0.2-preview.45 131 2 months ago
9.0.2-preview.44 161 2 months ago
9.0.2-preview.43 152 2 months ago
9.0.2-preview.42 147 2 months ago
9.0.2-preview.41 131 2 months ago
9.0.2-preview.39 48 2 months ago
9.0.2-preview.38 79 2 months ago
9.0.2-preview.37 93 2 months ago
9.0.2-preview.36 117 2 months ago
9.0.2-preview.35 129 2 months ago
9.0.2-preview.34 259 2 months ago
9.0.2-preview.33 262 2 months ago
9.0.2-preview.32 275 2 months ago
9.0.2-preview.31 261 2 months ago
9.0.2-preview.28 264 2 months ago
9.0.2-preview.25 258 2 months ago
9.0.2-preview.24 264 2 months ago
9.0.2-preview.23 262 2 months ago
9.0.2-preview.22 260 2 months ago
9.0.2-preview.21 285 2 months ago
9.0.2-preview.20 266 2 months ago
9.0.2-preview.19 259 2 months ago
9.0.2-preview.18 261 2 months ago
9.0.2-preview.16 215 2 months ago
9.0.2-preview.14 48 2 months ago
9.0.2-preview.13 47 2 months ago
9.0.2-preview.12 47 2 months ago
9.0.2-preview.5 66 2 months ago
9.0.2-preview.3 130 2 months ago
9.0.2-preview.2 125 2 months ago
9.0.2-preview.1 116 2 months ago
9.0.1-preview.0.335 239 2 months ago
9.0.1-preview.0.333 128 2 months ago
9.0.1-preview.0.332 120 2 months ago
9.0.1-preview.0.331 120 2 months ago
9.0.1-preview.0.329 44 2 months ago
9.0.1-preview.0.326 56 2 months ago
9.0.1-preview.0.324 45 2 months ago
9.0.1-preview.0.323 50 2 months ago
9.0.1-preview.0.321 72 2 months ago
9.0.1-preview.0.319 54 2 months ago
9.0.1-preview.0.318 66 2 months ago
9.0.1-preview.0.317 72 2 months ago
9.0.1-preview.0.316 76 2 months ago
9.0.1-preview.0.315 95 2 months ago
9.0.1-preview.0.314 80 2 months ago
9.0.1-preview.0.312 83 2 months ago
9.0.1-preview.0.309 119 3 months ago
9.0.1-preview.0.302 120 3 months ago
9.0.1-preview.0.301 159 3 months ago
9.0.1-preview.0.300 121 3 months ago
9.0.1-preview.0.299 127 3 months ago
9.0.1-preview.0.297 176 3 months ago
9.0.1-preview.0.296 130 2 months ago
9.0.1-preview.0.295 117 3 months ago
9.0.1-preview.0.294 124 3 months ago
9.0.1-preview.0.293 118 3 months ago
9.0.1-preview.0.290 126 3 months ago
9.0.1-preview.0.287 135 3 months ago
9.0.1-preview.0.286 222 3 months ago
9.0.1-preview.0.285 211 3 months ago
9.0.1-preview.0.279 202 3 months ago
9.0.1-preview.0.278 214 3 months ago
9.0.1-preview.0.277 210 3 months ago
9.0.1-preview.0.276 265 3 months ago
9.0.1-preview.0.274 127 3 months ago
9.0.1-preview.0.272 113 3 months ago
9.0.1-preview.0.271 111 3 months ago
9.0.1-preview.0.270 92 3 months ago
9.0.1-preview.0.267 118 3 months ago
9.0.1-preview.0.266 118 3 months ago
9.0.1-preview.0.265 125 3 months ago
9.0.1-preview.0.264 171 3 months ago
9.0.1-preview.0.263 123 3 months ago
9.0.1-preview.0.262 125 3 months ago
9.0.1-preview.0.261 128 3 months ago
9.0.1-preview.0.258 479 3 months ago
9.0.1-preview.0.255 91 3 months ago
9.0.1-preview.0.254 127 3 months ago
9.0.1-preview.0.253 120 3 months ago
9.0.1-preview.0.252 125 3 months ago
9.0.1-preview.0.251 120 3 months ago
9.0.1-preview.0.250 130 3 months ago
9.0.1-preview.0.247 137 3 months ago
9.0.1-preview.0.246 121 3 months ago
9.0.1-preview.0.244 157 4 months ago
9.0.1-preview.0.243 233 4 months ago
9.0.1-preview.0.242 162 4 months ago
9.0.1-preview.0.241 159 4 months ago
9.0.1-preview.0.239 159 4 months ago
9.0.1-preview.0.238 263 4 months ago
9.0.1-preview.0.237 218 4 months ago
9.0.1-preview.0.236 155 4 months ago
9.0.1-preview.0.235 136 4 months ago
9.0.1-preview.0.234 148 4 months ago
9.0.1-preview.0.233 171 4 months ago
9.0.1-preview.0.232 134 4 months ago
9.0.1-preview.0.231 132 4 months ago
9.0.1-preview.0.230 188 4 months ago
9.0.1-preview.0.229 148 4 months ago
9.0.1-preview.0.228 150 4 months ago
9.0.1-preview.0.227 141 4 months ago
9.0.1-preview.0.226 137 4 months ago
9.0.1-preview.0.220 172 4 months ago
9.0.1-preview.0.219 125 4 months ago
9.0.1-preview.0.218 125 4 months ago
9.0.1-preview.0.217 189 4 months ago
9.0.1-preview.0.215 150 4 months ago
9.0.1-preview.0.214 130 4 months ago
9.0.1-preview.0.213 150 4 months ago
9.0.1-preview.0.212 157 4 months ago
9.0.1-preview.0.211 131 4 months ago
9.0.1-preview.0.210 134 4 months ago
9.0.1-preview.0.209 147 4 months ago
9.0.1-preview.0.208 151 4 months ago
9.0.1-preview.0.206 133 4 months ago
9.0.1-preview.0.205 141 4 months ago
9.0.1-preview.0.204 138 4 months ago
9.0.1-preview.0.202 130 4 months ago
9.0.1-preview.0.199 67 4 months ago
9.0.1-preview.0.198 105 5 months ago
9.0.1-preview.0.196 112 5 months ago
9.0.1-preview.0.193 105 5 months ago
9.0.1-preview.0.189 130 5 months ago
9.0.1-preview.0.188 460 5 months ago
9.0.1-preview.0.187 469 5 months ago
9.0.1-preview.0.186 456 5 months ago
9.0.1-preview.0.185 457 5 months ago
9.0.1-preview.0.184 460 5 months ago
9.0.1-preview.0.183 456 5 months ago
9.0.1-preview.0.182 67 5 months ago
9.0.1-preview.0.180 118 5 months ago
9.0.1-preview.0.179 127 5 months ago
9.0.1-preview.0.178 124 5 months ago
9.0.1-preview.0.175 126 5 months ago
9.0.1-preview.0.174 127 5 months ago
9.0.1-preview.0.173 142 5 months ago
9.0.1-preview.0.172 289 5 months ago
9.0.1-preview.0.171 124 5 months ago
9.0.1-preview.0.170 124 5 months ago
9.0.1-preview.0.165 123 5 months ago
9.0.1-preview.0.162 133 5 months ago
9.0.1-preview.0.160 126 5 months ago
9.0.1-preview.0.152 106 5 months ago
9.0.1-preview.0.148 147 5 months ago
9.0.1-preview.0.147 127 5 months ago
9.0.1-preview.0.146 130 5 months ago
9.0.1-preview.0.145 136 5 months ago
9.0.1-preview.0.141 133 5 months ago
9.0.1-preview.0.140 175 5 months ago
9.0.1-preview.0.139 131 5 months ago
9.0.1-preview.0.138 146 5 months ago
9.0.1-preview.0.137 124 5 months ago
9.0.1-preview.0.135 141 5 months ago
9.0.1-preview.0.134 180 5 months ago
9.0.1-preview.0.133 174 5 months ago
9.0.1-preview.0.132 169 5 months ago
9.0.1-preview.0.130 169 5 months ago
9.0.1-preview.0.129 223 5 months ago
9.0.1-preview.0.128 176 5 months ago
9.0.1-preview.0.127 182 5 months ago
9.0.1-preview.0.125 189 5 months ago
9.0.1-preview.0.119 84 6 months ago
9.0.1-preview.0.118 66 6 months ago
9.0.1-preview.0.116 72 6 months ago
9.0.1-preview.0.112 62 6 months ago
9.0.1-preview.0.111 70 6 months ago
9.0.1-preview.0.110 119 6 months ago
9.0.1-preview.0.107 85 6 months ago
9.0.1-preview.0.106 76 6 months ago
9.0.1-preview.0.105 72 6 months ago
9.0.1-preview.0.104 78 6 months ago
9.0.1-preview.0.103 98 6 months ago
9.0.1-preview.0.102 94 6 months ago
9.0.1-preview.0.100 63 6 months ago
9.0.1-preview.0.99 105 6 months ago
9.0.1-preview.0.97 74 6 months ago
9.0.1-preview.0.96 68 6 months ago
9.0.1-preview.0.94 70 6 months ago
9.0.1-preview.0.93 99 6 months ago
9.0.1-preview.0.92 69 6 months ago
9.0.1-preview.0.91 61 6 months ago
9.0.1-preview.0.88 69 6 months ago
9.0.1-preview.0.87 252 6 months ago
9.0.1-preview.0.85 271 6 months ago
9.0.1-preview.0.84 210 6 months ago
9.0.1-preview.0.82 170 6 months ago
9.0.1-preview.0.79 178 6 months ago
9.0.1-preview.0.78 198 6 months ago
9.0.1-preview.0.77 173 6 months ago
9.0.1-preview.0.76 211 6 months ago
9.0.1-preview.0.73 202 6 months ago
9.0.1-preview.0.71 148 6 months ago
9.0.1-preview.0.70 193 6 months ago
9.0.1-preview.0.69 185 6 months ago
9.0.1-preview.0.67 192 6 months ago
9.0.1-preview.0.62 177 6 months ago
9.0.1-preview.0.58 84 6 months ago
9.0.1-preview.0.56 76 6 months ago
9.0.1-preview.0.55 62 6 months ago
9.0.1-preview.0.54 66 6 months ago
9.0.1-preview.0.53 60 6 months ago
9.0.1-preview.0.52 64 6 months ago
9.0.1-preview.0.50 80 6 months ago
9.0.1-preview.0.49 123 6 months ago
9.0.1-preview.0.47 64 6 months ago
9.0.1-preview.0.45 69 6 months ago
9.0.1-preview.0.43 70 6 months ago
9.0.1-preview.0.42 68 6 months ago
9.0.1-preview.0.41 71 6 months ago
9.0.1-preview.0.35 73 6 months ago
9.0.1-preview.0.20 68 6 months ago
9.0.1-preview.0.19 61 6 months ago
9.0.1-preview.0.18 65 6 months ago
9.0.1-preview.0.14 64 6 months ago
9.0.1-preview.0.13 73 6 months ago
9.0.1-preview.0.11 60 6 months ago
9.0.1-preview.0.10 58 6 months ago
9.0.1-preview.0.9 64 7 months ago
9.0.1-preview.0.2 121 7 months ago
3.0.5-preview.0.2 134 4 months ago
3.0.5-preview.0.1 85 6 months ago
3.0.4 510 7 months ago
3.0.4-preview.0.38 73 7 months ago
3.0.4-preview.0.37 111 8 months ago
3.0.4-preview.0.36 204 8 months ago
3.0.4-preview.0.34 75 8 months ago
3.0.4-preview.0.32 75 8 months ago
3.0.4-preview.0.31 92 9 months ago
3.0.4-preview.0.30 72 9 months ago
3.0.4-preview.0.29 65 9 months ago
3.0.4-preview.0.28 125 9 months ago
3.0.4-preview.0.27 67 9 months ago
3.0.4-preview.0.23 70 9 months ago
3.0.4-preview.0.21 59 9 months ago
3.0.4-preview.0.20 64 9 months ago
3.0.4-preview.0.19 74 9 months ago
3.0.4-preview.0.18 60 9 months ago
3.0.4-preview.0.17 62 9 months ago
3.0.4-preview.0.16 68 9 months ago
3.0.4-preview.0.15 64 9 months ago
3.0.4-preview.0.14 82 9 months ago
3.0.4-preview.0.13 76 9 months ago
3.0.4-preview.0.12 68 9 months ago
3.0.4-preview.0.8 74 9 months ago
3.0.4-preview.0.7 75 9 months ago
3.0.4-preview.0.6 66 10 months ago
3.0.4-preview.0.5 74 10 months ago
3.0.4-preview.0.4 65 10 months ago
3.0.4-preview.0.3 66 10 months ago
3.0.4-preview.0.2 71 10 months ago
3.0.4-preview.0.1 209 10 months ago
3.0.3 394 10/11/2024
3.0.3-preview.0.56 81 10/10/2024
3.0.3-preview.0.55 75 10/10/2024
3.0.3-preview.0.54 79 10/10/2024
3.0.3-preview.0.50 75 10/10/2024
3.0.3-preview.0.49 91 10/9/2024
3.0.3-preview.0.44 96 10/8/2024
3.0.3-preview.0.43 72 10/8/2024
3.0.3-preview.0.42 73 10/7/2024
3.0.3-preview.0.41 75 10/7/2024
3.0.3-preview.0.40 108 10/1/2024
3.0.3-preview.0.39 76 10/1/2024
3.0.3-preview.0.38 72 10/1/2024
3.0.3-preview.0.36 77 9/30/2024
3.0.3-preview.0.35 93 9/26/2024
3.0.3-preview.0.34 86 9/26/2024
3.0.3-preview.0.33 73 9/26/2024
3.0.3-preview.0.32 103 9/24/2024
3.0.3-preview.0.31 774 9/10/2024
3.0.3-preview.0.30 71 9/9/2024
3.0.3-preview.0.29 67 9/9/2024
3.0.3-preview.0.28 58 9/8/2024
3.0.3-preview.0.27 81 9/5/2024
3.0.3-preview.0.26 78 9/3/2024
3.0.3-preview.0.25 69 9/3/2024
3.0.3-preview.0.24 82 9/3/2024
3.0.3-preview.0.23 92 8/21/2024
3.0.3-preview.0.22 62 7/29/2024
3.0.3-preview.0.21 80 7/25/2024
3.0.3-preview.0.18 81 7/12/2024
3.0.3-preview.0.17 76 7/12/2024
3.0.3-preview.0.16 64 7/12/2024
3.0.3-preview.0.15 68 7/5/2024
3.0.3-preview.0.14 135 6/24/2024
3.0.3-preview.0.13 97 6/23/2024
3.0.3-preview.0.12 88 6/21/2024
3.0.3-preview.0.11 95 6/20/2024
3.0.3-preview.0.9 369 5/27/2024
3.0.3-preview.0.8 79 5/27/2024
3.0.3-preview.0.7 108 5/17/2024
3.0.3-preview.0.6 83 5/14/2024
3.0.3-preview.0.5 324 5/8/2024
3.0.3-preview.0.3 106 5/6/2024
3.0.3-preview.0.1 94 4/25/2024
3.0.2 1,351 4/25/2024
3.0.2-preview.0.4 102 4/25/2024
3.0.2-preview.0.3 157 4/25/2024
3.0.2-preview.0.2 105 4/25/2024
3.0.2-preview.0.1 81 4/25/2024
3.0.1 444 4/25/2024
3.0.1-preview.0.10 91 4/24/2024
3.0.1-preview.0.9 194 4/19/2024
3.0.1-preview.0.8 75 4/24/2024
3.0.1-preview.0.7 143 4/24/2024

## Release 3.0.1 [25.04.24]

- [N] Initial release

-----

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