OptimusFramework.Utils 2.2.0

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

OptimusFramework.Utils

Core utility library for the Optimus Framework ecosystem. Provides base entities, DTOs, enums, validation, and common utilities used across all framework layers.

Features

  • Base Entity Interfaces: IEntity, IIdEntity<TKey>, INameDescEntity<TKey> for consistent domain modeling
  • Standard API Response: ApiResponse<TData> with error handling, alert messages, and validation support
  • Multi-Tenant Support: TenantDto with connection configuration, security settings, and parameter management
  • Validation Pipeline: ValidationMessageBuilder with FluentValidation integration
  • Cryptographic Utilities: SHA-256, SHA-384, SHA-512, MD5 hashing via Util class
  • Data Compression: GZip compress/decompress helpers
  • AutoMapper Integration: Object mapping support across layers
  • Geographic Calculations: GeoCoordinate distance calculations between GeoLocation points
  • Custom Exceptions: OptimusException and BusinessException with error codes and alert messages

Key Classes and Interfaces

Type Description
IEntity Base entity with Status, CreateDate, CreateUserId, EditUserId
IIdEntity<TKey> Entity with typed Id property
INameDescEntity<TKey> Entity with Name and Description
ApiResponse<TData> Standard API response wrapper
ApiParam<T> Generic API request parameter
TenantDto Multi-tenant configuration
PagedListDto<TData> Paginated list response
PagedListParam<TParam> Paginated list request
ValidationMessageBuilder Fluent validation message builder
IRepoTenant Tenant repository interface
IMessageProcessor Message processing interface
Util Static crypto, conversion, and utility methods
StateEnum Entity states: Enabled, Disabled, Deleted

Installation

dotnet add package OptimusFramework.Utils

Usage

using OptimusFramework.Utils.Dtos.Request;
using OptimusFramework.Utils.Enums;

// Standard API response
var response = ApiResponse<MyDto>.CreateOk(data);

// Validation
var builder = new ValidationMessageBuilder();
builder.Validate<MyValidator, MyEntity>(entity);
if (builder.HasExceptions)
    throw new BusinessException(builder.Messages);

// Hashing
string hash = Util.ComputeSha256Hash("my-data");
Product Compatible and additional computed target framework versions.
.NET 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 (11)

Showing the top 5 NuGet packages that depend on OptimusFramework.Utils:

Package Downloads
OptimusFramework.DataAccess.EFCore

Package Description

OptimusFramework.DataAccess.Domain

Package Description

OptimusFramework.AppService.Domain

Package Description

OptimusLog.DataTransfer

Package Description

OptimusFramework.AppService.Generic

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 111 4/3/2026
2.1.0 109 4/3/2026
2.0.1 293 2/18/2026
2.0.0 258 2/18/2026
1.1.0 120 4/3/2026