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" />
<PackageReference Include="OptimusFramework.Utils" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=OptimusFramework.Utils&version=2.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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:
TenantDtowith connection configuration, security settings, and parameter management - Validation Pipeline:
ValidationMessageBuilderwith FluentValidation integration - Cryptographic Utilities: SHA-256, SHA-384, SHA-512, MD5 hashing via
Utilclass - Data Compression: GZip compress/decompress helpers
- AutoMapper Integration: Object mapping support across layers
- Geographic Calculations:
GeoCoordinatedistance calculations betweenGeoLocationpoints - Custom Exceptions:
OptimusExceptionandBusinessExceptionwith 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 | Versions 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.
-
net10.0
- AutoMapper (>= 13.0.1)
- FluentValidation (>= 11.9.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Newtonsoft.Json (>= 13.0.3)
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.