UA.Tenet 4.9.3

dotnet add package UA.Tenet --version 4.9.3
                    
NuGet\Install-Package UA.Tenet -Version 4.9.3
                    
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="UA.Tenet" Version="4.9.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UA.Tenet" Version="4.9.3" />
                    
Directory.Packages.props
<PackageReference Include="UA.Tenet" />
                    
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 UA.Tenet --version 4.9.3
                    
#r "nuget: UA.Tenet, 4.9.3"
                    
#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 UA.Tenet@4.9.3
                    
#: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=UA.Tenet&version=4.9.3
                    
Install as a Cake Addin
#tool nuget:?package=UA.Tenet&version=4.9.3
                    
Install as a Cake Tool

UA.Tenet

NuGet Downloads

UA.Tenet is the core library of the Tenet Framework, implementing the Tenet methodology and best practices for .NET development. It provides a comprehensive set of design patterns, utilities, and infrastructure components to build maintainable, scalable, and well-structured applications.

Features

🎯 Design Patterns

  • Singleton Pattern: Thread-safe singleton implementation with lazy initialization
  • Command Pattern: Encapsulate requests as objects with execute/undo capabilities
  • Observer Pattern: Reactive event handling with publisher-subscriber model
  • Chain of Responsibility: Process requests through a chain of handlers
  • Result Pattern: Type-safe error handling without exceptions
  • Request/Response Pattern: Structured communication between components

πŸ”§ Agent & Service Infrastructure

  • AgentBase: Base class for autonomous agent implementations
  • ServiceBase: Foundation for service-oriented architecture
  • Dependency Injection Extensions: Automatic registration of services and agents based on attributes
  • Lifetime Management: Control over singleton, scoped, and transient lifetimes

πŸ“Š Data Utilities

  • JSON: Fast JSON serialization/deserialization helpers
  • XML: XML document manipulation utilities
  • CSV: CSV parsing and generation
  • SQL: SQL query building and parameter handling
  • HTTP: Simplified HTTP client operations

πŸ“¦ Collections

  • CanonicalSet: Set with canonical (by default, same as case-insenstive) key comparison
  • Any: Dictionary with case-insenstive key comparison
  • TLINQ: Tenet built-in LINQ dynamic operations with queryable extensions

πŸ”€ Smart Enums

  • Type-safe enumerations with additional functionality
  • JSON serialization support
  • Comparison and equality operations

πŸ’¬ Messaging & Events

  • IMessageBroker: In-memory message broker abstraction
  • IEventBroker: Event-driven architecture support
  • InMemory Implementations: Ready-to-use broker implementations

🎨 Expressions

  • ConditionalExpression: TLINQ and JSON compatible conditional expression
  • RuleExpression: TLINQ and JSON compatible business rule evaluation engine

πŸ—ΊοΈ Mapping

  • IMappable: Interface for object mapping
  • Extensions: Object-to-dictionary and dictionary-to-object mapping

Installation

Install via NuGet Package Manager:

dotnet add package UA.Tenet

Or via Package Manager Console:

Install-Package UA.Tenet

Quick Start

Using Services with Dependency Injection

using UA.Tenet.Services;
using UA.Tenet.Services.Extensions;

// Register Tenet services
builder.Services.AddTenetServices();

// Define your service (services have a scoped lifetime by default)
[TenetService]
public class MyService : ServiceBase
{
    public void DoWork()
    {
        // Your logic here
    }
}

Using the Result Pattern

using UA.Tenet.Design;

public Result<Customer> GetCustomer(int id)
{
    Result<Customer> result = new();

    if (_repository.FindById(id) is Customer customer)
    {
        result.Value = customer;
    }
    else
    {
        Any<object?> error = new() { ["Message"] = "Customer not found" };
        result.WithErrors(id.ToString(), error);
    }

    return result;
}

Working with Smart Enums

using UA.Tenet.Enums;

public class OrderStatus : SmartEnum<OrderStatus>
{
    public static readonly OrderStatus Pending = new(1, "Pending");

    public static readonly OrderStatus Confirmed = new(2, "Confirmed");  

    public static readonly OrderStatus Shipped = new(3, "Shipped");
    
    private OrderStatus(int value, string name) : base(value, name) { }
}

Using Agents

using UA.Tenet.Agents;
using UA.Tenet.Agents.Extensions;

// Register Tenet agents
builder.Services.AddTenetAgents();

// Define your agent (agents have a singleton lifetime by default)
[TenetAgent]
public class ProcessingAgent : AgentBase
{
    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
        // Background processing logic
    }
}

Tenet Framework Principles

The Tenet Framework is built on five core principles (AEIOU):

  • Accessibility: Seamless integration and resource provisioning
  • Extension: Modularity and adaptability through reusable components
  • Independence: Loose coupling and high cohesion
  • Order: Clear and consistent project structure
  • Unicity: Unique implementation of responsibilities

Documentation

For comprehensive documentation, tutorials, and API reference, visit:


Made with ❀️ by UA Devs @ Chiclana de la Frontera (Spain)

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 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 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 (2)

Showing the top 2 NuGet packages that depend on UA.Tenet:

Package Downloads
UA.Azure.Storage

UA.Azure.Storage provides a lightweight, efficient implementation for accessing Azure Storage Services (Blob, Queue, and Table) in .NET applications. Built on the Tenet Framework principles, it offers a simplified agent-based approach to interact with Azure Storage without heavy SDK dependencies.

UA.Tenet.Web

UA.Tenet.Web extends the Tenet Framework for ASP.NET Core applications. It provides a unified convention-based configuration combining the structure of Controller-based APIs with the performance of Minimal APIs, along with TagHelpers, view components, and web extensions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.9.3 61 3/4/2026
4.9.2 124 3/2/2026
Loading failed

See https://tenet.uadevs.org/ for release notes and documentation.