Tooark 4.10.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Tooark --version 4.10.0
                    
NuGet\Install-Package Tooark -Version 4.10.0
                    
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="Tooark" Version="4.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tooark" Version="4.10.0" />
                    
Directory.Packages.props
<PackageReference Include="Tooark" />
                    
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 Tooark --version 4.10.0
                    
#r "nuget: Tooark, 4.10.0"
                    
#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 Tooark@4.10.0
                    
#: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=Tooark&version=4.10.0
                    
Install as a Cake Addin
#tool nuget:?package=Tooark&version=4.10.0
                    
Install as a Cake Tool

Tooark

Library with every Tooark resource and feature aimed at .NET projects.

πŸ“– Docs: Tooark on the site Β· All packages Β· API reference

🌍 Languages: πŸ‡ΊπŸ‡Έ English (this file) Β· πŸ‡§πŸ‡· PortuguΓͺs


πŸ“‘ Contents


πŸ”§ Installation

dotnet add package Tooark

The aggregator brings every Tooark package at once. Install the packages individually when you only want some of them β€” the surface is the same.

The exception is the storage and secrets providers (Tooark.Storage.Aws, Tooark.Storage.Gcp, Tooark.Secrets.Aws, Tooark.Secrets.Gcp and Tooark.Secrets.Vault): the aggregator brings only the Tooark.Storage and Tooark.Secrets abstractions, and the application installs the provider it uses.


βš™οΈ Configuration

The translations ship with the assembly, so there is nothing to configure for them to work.

Add the following line to your Program.cs:

// Importing the required namespaces
using Tooark.Injections;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();

IConfiguration configuration = new ConfigurationBuilder()
  .Build();

// In your service configuration
services.AddTooarkService(configuration);

That single call registers Tooark.Dtos, Tooark.Extensions, Tooark.ValueObjects, Tooark.Mediator and Tooark.Sanitizers. The rest depends on the configuration:

  • with the Jwt or Cryptography section, it registers Tooark.Securities: the JWT token service and the cryptography service (each one when its own section exists), password hashing and, when the DataProtection section exists, Data Protection;
  • with the Observability section, it registers Tooark.Observability.

To make the application fail at startup when one of those sections has a mistyped key, turn on strict configuration ("Tooark": { "StrictConfiguration": true }).

What depends on your application stays out and is registered on its own: the unit of work, entity auditing on Entity Framework Core, the ASP.NET Core responses, JWT Bearer authentication, OpenID Connect SSO, the HTTP client, storage and secrets. The sections below show each one.

Where the mediator handlers are looked up

Without an argument, in the assembly that called AddTooarkService. In a single-project application that is what you want, and there is nothing to do.

In a layered application the handlers usually live in another project. Pass the assemblies:

services.AddTooarkService(configuration, typeof(MyHandler).Assembly);

Calling AddTooarkMediator afterwards also works, to add assemblies or configure the options β€” the handler registration does not duplicate:

using Tooark.Mediator.Injections;

services.AddTooarkService(configuration);
services.AddTooarkMediator(typeof(MyHandler).Assembly);

Careful when calling AddTooarkService from inside a library of yours. The assembly looked up is the caller's, so it would be your library's, not the application's. Pass the right assembly along.

Unit of work

Stays out of AddTooarkService, because it depends on the type of your Entity Framework context:

using Tooark.Mediator.EntityFrameworkCore.Injections;

services.AddTooarkMediatorUnitOfWork<MyDbContext>();

Entity auditing and soft delete

They also stay out of AddTooarkService, because they depend on your context and on who the current user is in your application. The interceptor stamps the audit fields and turns Remove() into a soft delete:

using Tooark.Entities.EntityFrameworkCore.Extensions;
using Tooark.Entities.EntityFrameworkCore.Injections;

services.AddTooarkEntityFrameworkCore<MyCurrentUser>(); // MyCurrentUser implements ICurrentUser
services.AddDbContext<MyDbContext>((provider, options) => options
  .UseNpgsql(connectionString)
  .AddTooarkInterceptors(provider));

In OnModelCreating, call modelBuilder.ApplyTooarkConventions() last. The details are in Tooark.Entities.EntityFrameworkCore.

ASP.NET Core responses

They also stay out of AddTooarkService, because they change the body of your API's HTTP responses. Register what the application uses:

using Tooark.AspNetCore.Injections;

services.AddTooarkModelStateEnvelope(); // [ApiController] validation failures in the Tooark envelope
services.AddTooarkProblemDetails();     // Tooark exceptions as application/problem+json (RFC 9457)

app.UseExceptionHandler();              // required by AddTooarkProblemDetails

The details are in Tooark.AspNetCore.

JWT Bearer authentication

AddTooarkService registers the service that issues and validates tokens, but not the authentication scheme. An application that protects endpoints with [Authorize] registers the Bearer scheme, which reads the same Jwt section:

using Tooark.Securities.Injections;

services.AddTooarkJwtBearer(configuration);

app.UseAuthentication();
app.UseAuthorization();

OpenID Connect SSO

Also stays out of AddTooarkService: the same provider can back an interactive login (OpenIdConnect handler) or an API (JwtBearer handler), and that choice is yours. Register it explicitly:

using Tooark.Securities.OpenId.Injections;

services.AddTooarkEntraSso(configuration);   // reads OpenId:Entra
services.AddTooarkGoogleSso(configuration);  // reads OpenId:Google

HTTP client

It also stays out of AddTooarkService: not every application calls other services, and the registration creates a client with resilience. Register it when the application needs it:

using Tooark.Http.Injections;

services.AddTooarkHttpClient(configuration); // reads HttpClient

The details, including the outbound guard against SSRF, are in Tooark.Http.

Storage

Also stays out of AddTooarkService, and the provider does not come with the aggregator: install the package of the cloud you use and register it:

using Tooark.Storage.Aws.Injections;

services.AddTooarkStorageAws(configuration); // reads Storage

Secrets

The store is a configuration source, added before the configuration reaches AddTooarkService, and the provider does not come with the aggregator:

using Tooark.Secrets.Aws.Injections;

IConfiguration configuration = new ConfigurationBuilder()
  .AddJsonFile("appsettings.json")
  .AddTooarkSecretsAws() // reads Secrets from appsettings.json
  .Build();

services.AddTooarkService(configuration);

✨ Available features

Tooark.Attributes

Description: This package provides custom attributes for use in .NET projects.

Tooark.AspNetCore

Description: This package gathers the features that depend on ASP.NET Core: reading ModelState errors, the validation failure envelope and Problem Details (RFC 9457) responses for the Tooark exceptions.

Tooark.Dtos

Description: This package contains data transfer objects (DTOs) that ease the communication between application layers.

Tooark.Entities

Description: This package defines the domain entities used by the application.

Tooark.Entities.EntityFrameworkCore

Description: This package plugs the entities into Entity Framework Core: it stamps the audit fields, turns Remove() into a soft delete and applies the soft delete filter and the concurrency token.

Tooark.Enums

Description: This package contains the enum definitions used across the application.

Tooark.Exceptions

Description: This package provides custom exceptions for use in .NET projects.

Tooark.Extensions

Description: This package provides extension methods for common .NET types and classes.

Tooark.Http

Description: This package makes the outbound HTTP calls: a thin JSON service over IHttpClientFactory, with resilience, errors in the Tooark standard and an outbound guard against SSRF.

Tooark.Notifications

Description: This package offers features to manage notifications and messages in the application.

Tooark.Mediator.Abstractions

Description: This package provides the base contracts of the Mediator pattern for use in .NET projects.

Tooark.Mediator

Description: This package offers a concrete implementation of the Mediator pattern, easing the communication between application components.

Tooark.Mediator.EntityFrameworkCore

Description: This package moves Entity Framework Core persistence into the Mediator pipeline, keeping handlers free of SaveChanges.

Tooark.Observability

Description: This package integrates OpenTelemetry (traces, metrics and logs) through configuration, with the service identity resolved and the instrumentation ready for injection.

Tooark.Sanitizers

Description: This package sanitizes HTML with an allowlist, URLs with a scheme allowlist and the @tooark/wysiwyg editor content, with the same rules the component applies in the browser.

Tooark.Secrets

Description: This package loads secrets and parameters from vaults (AWS, Google Cloud, Vault and OpenBao) into the configuration and reads secrets at runtime. The providers, Tooark.Secrets.Aws, Tooark.Secrets.Gcp and Tooark.Secrets.Vault, are installed separately.

Tooark.Securities

Description: This package offers JWT (issuing, validation and Bearer authentication), AES cryptography with key rotation, password hashing, secure tokens, TOTP with recovery codes and the Data Protection configuration.

Tooark.Securities.OpenId

Description: This package configures the native ASP.NET Core OpenID Connect handlers, with SSO presets for Microsoft Entra ID and Google.

Tooark.Storage

Description: This package defines the cloud object storage contract (upload, download, delete, metadata and signed URLs). The providers, Tooark.Storage.Aws and Tooark.Storage.Gcp, are installed separately.

Tooark.Utils

Description: This package contains utilities and helper functions for assorted operations.

Tooark.Validations

Description: This package provides validation features for data and entities.

Tooark.ValueObjects

Description: This package defines the value objects used by the application.


🀝 Contributing

Contributions are welcome! Start with CONTRIBUTING.md β€” it covers the development workflow, the coding and commit conventions and the pull request checklist. Bugs and feature requests go through the issue templates of the Tooark repository.

By participating you agree to the Code of Conduct.


πŸ†˜ Help & Security

  • ❓ Questions, bugs, feature ideas β€” see SUPPORT.md for the right channel
  • πŸ”’ Security vulnerabilities β€” do not open a public issue; follow SECURITY.md

πŸ’– Support

If Tooark helps your projects, consider supporting its development:

Every contribution helps keep the project maintained and improving. Thank you! πŸ™


πŸ“„ License

This project is licensed under the BSD 3-Clause License.

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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.11.0 0 11/21/2026
4.10.0 48 11/18/2026
4.9.0 69 11/16/2026
4.8.0 102 11/15/2026
4.7.3 92 11/11/2026
4.7.2 89 11/3/2026
4.7.1 110 10/17/2026
4.7.0 120 9/30/2026
4.6.0 131 9/29/2026
4.5.0 90 9/29/2026
4.4.0 97 9/28/2026
4.3.0 98 9/26/2026
4.2.1 94 9/25/2026
4.2.0 108 9/20/2026
4.1.0 93 9/18/2026
4.0.1 126 8/25/2026
3.3.7 57 11/15/2026
3.3.6 95 9/18/2026
2.3.6 52 11/15/2026
2.3.5 93 9/18/2026
Loading failed