DropBear.Codex.Core
2025.10.83-gf875cf067d
dotnet add package DropBear.Codex.Core --version 2025.10.83-gf875cf067d
NuGet\Install-Package DropBear.Codex.Core -Version 2025.10.83-gf875cf067d
<PackageReference Include="DropBear.Codex.Core" Version="2025.10.83-gf875cf067d" />
<PackageVersion Include="DropBear.Codex.Core" Version="2025.10.83-gf875cf067d" />
<PackageReference Include="DropBear.Codex.Core" />
paket add DropBear.Codex.Core --version 2025.10.83-gf875cf067d
#r "nuget: DropBear.Codex.Core, 2025.10.83-gf875cf067d"
#:package DropBear.Codex.Core@2025.10.83-gf875cf067d
#addin nuget:?package=DropBear.Codex.Core&version=2025.10.83-gf875cf067d&prerelease
#tool nuget:?package=DropBear.Codex.Core&version=2025.10.83-gf875cf067d&prerelease
DropBear.Codex.Core
Core library providing Result pattern, functional extensions, and telemetry infrastructure for .NET 9+ applications.
🚀 Quick Start
Installation
dotnet add package DropBear.Codex.Core
Basic Usage
using DropBear.Codex.Core.Results;
using DropBear.Codex.Core.Results.Errors;
// Create a result-returning method
public Result<int, ValidationError> Divide(int numerator, int denominator)
{
if (denominator == 0)
{
return Result<int, ValidationError>.Failure(
new ValidationError("Cannot divide by zero"));
}
return Result<int, ValidationError>.Success(numerator / denominator);
}
// Use pattern matching
var result = Divide(10, 2);
var message = result.Match(
success: value => $"Result: {value}",
failure: error => $"Error: {error.Message}"
);
// Chain operations
var doubled = result.Map(x => x * 2);
var combined = result.Bind(x => Divide(x, 3));
✨ Features
Result Pattern
Type-safe error handling without exceptions:
Result<User, ValidationError> GetUser(int id)
{
if (id <= 0)
return Result<User, ValidationError>.Failure(
new ValidationError("Invalid ID"));
var user = _repository.Find(id);
return user != null
? Result<User, ValidationError>.Success(user)
: Result<User, ValidationError>.Failure(
new ValidationError("User not found"));
}
Functional Extensions
Map, Bind, Match and more:
var result = await GetUserAsync(userId)
.MapAsync(user => user.Email)
.BindAsync(email => SendEmailAsync(email))
.TapAsync(async () => await LogSuccessAsync())
.OnFailureAsync(async error => await LogErrorAsync(error));
Telemetry Integration
Built-in OpenTelemetry support:
// Configure telemetry at startup
TelemetryProvider.Configure(options =>
{
options.Mode = TelemetryMode.BackgroundChannel;
options.ChannelCapacity = 10000;
});
// Automatic telemetry tracking
var result = Result<int, ValidationError>.Success(42);
// Telemetry automatically recorded!
Async/Await Support
First-class async operations:
public async Task<Result<Data, ErrorType>> ProcessAsync(
CancellationToken cancellationToken = default)
{
return await GetDataAsync(cancellationToken)
.MapAsync(async (data, ct) => await TransformAsync(data, ct), cancellationToken)
.BindAsync(async (data, ct) => await ValidateAsync(data, ct), cancellationToken);
}
Envelope Pattern
Message wrapping with metadata:
var envelope = new EnvelopeBuilder<MyData>()
.WithPayload(myData)
.AddHeader("version", "1.0")
.AddHeader("source", "api")
.Build();
// Serialize and deserialize
var json = await envelopeSerializer.SerializeAsync(envelope);
var restored = await envelopeSerializer.DeserializeAsync(json);
📖 Documentation
🎯 Key Benefits
- ✅ Type-Safe - Compile-time error handling
- ✅ Railway Oriented - Clean error propagation
- ✅ High Performance - .NET 9 optimized with minimal allocations
- ✅ Observable - OpenTelemetry integration out of the box
- ✅ Testable - Pure functions, easy to mock
- ✅ Well-Documented - Comprehensive XML docs
🔧 Requirements
- .NET 9.0 or later
- C# 12 or later
📦 Related Packages
- DropBear.Codex.Blazor - Blazor components and utilities
- DropBear.Codex.Hashing - Cryptographic hashing utilities
- DropBear.Codex.Serialization - Advanced serialization
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please read our Contributing Guidelines first.
💬 Support
- 📧 Email: [your-email@example.com]
- 🐛 Issues: GitHub Issues
- 💡 Discussions: GitHub Discussions
Made with ❤️ by Terrence Kuchel
| Product | Versions 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. |
-
net9.0
- MessagePack (>= 3.1.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.ObjectPool (>= 9.0.10)
- Serilog (>= 4.3.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Enrichers.Process (>= 3.0.0)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Formatting.Compact (>= 3.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.File (>= 7.0.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on DropBear.Codex.Core:
| Package | Downloads |
|---|---|
|
DropBear.Codex.Utilities
Provides utility classes and helpers for the DropBear.Codex ecosystem |
|
|
DropBear.Codex.StateManagement
Simplified state management and snapshot system for the DropBear Codex framework. |
|
|
DropBear.Codex.Serialization
Provides serialization and deserialization utilities for the DropBear.Codex ecosystem |
|
|
DropBear.Codex.Files
Provides file management and storage capabilities for the DropBear.Codex ecosystem |
|
|
DropBear.Codex.Hashing
Provides various hashing implementations and utilities for the DropBear.Codex ecosystem |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.10.83-gf875cf067d | 181 | 11/8/2025 |
| 2025.2.80 | 282 | 3/2/2025 |
| 2025.0.14 | 244 | 1/7/2025 |
| 2024.11.5 | 271 | 11/12/2024 |
| 2024.9.44 | 295 | 9/20/2024 |
| 2024.9.43 | 267 | 9/16/2024 |
| 2024.9.42 | 272 | 9/16/2024 |
| 2024.9.32 | 265 | 9/13/2024 |
| 2024.9.25 | 285 | 9/11/2024 |
| 2024.9.1 | 271 | 9/8/2024 |
| 2024.8.54 | 278 | 9/6/2024 |
| 2024.8.36 | 260 | 9/2/2024 |
| 2024.7.1 | 246 | 7/24/2024 |
| 2024.6.2 | 260 | 6/19/2024 |
| 2024.5.9 | 274 | 5/19/2024 |
| 2024.5.8 | 154 | 5/19/2024 |
| 2024.5.6 | 414 | 5/4/2024 |
| 2024.5.5 | 148 | 5/4/2024 |
| 2024.5.4 | 209 | 5/4/2024 |
| 2024.5.3 | 119 | 5/3/2024 |
| 2024.5.2 | 130 | 5/3/2024 |
| 2024.5.1 | 138 | 5/3/2024 |
| 2024.4.8 | 576 | 4/30/2024 |
| 2024.4.5 | 910 | 4/17/2024 |
| 2024.4.4 | 174 | 4/16/2024 |
| 2024.4.3 | 164 | 4/16/2024 |
| 2024.4.1 | 275 | 4/13/2024 |
| 2024.3.13 | 581 | 3/28/2024 |
| 2024.3.12 | 257 | 3/21/2024 |
| 2024.3.11 | 284 | 3/16/2024 |
| 2024.3.10 | 178 | 3/16/2024 |
| 2024.3.9 | 171 | 3/15/2024 |
| 2024.3.6 | 176 | 3/15/2024 |
| 2024.3.5 | 172 | 3/13/2024 |
| 2024.3.4 | 232 | 3/11/2024 |
| 2024.3.1 | 189 | 3/2/2024 |
| 2024.2.34 | 199 | 2/26/2024 |
| 2024.2.31 | 181 | 2/26/2024 |
| 2024.2.30 | 240 | 2/22/2024 |
| 2024.2.25 | 232 | 2/21/2024 |