Terminalogic.Essentials 1.0.0

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

Terminalogic.Essentials

Lightweight enterprise infrastructure utilities for modern .NET applications.

Terminalogic.Essentials is a reusable utility framework built for ASP.NET Core and .NET applications that simplifies:

  • MSSQL database access
  • Email delivery
  • Authentication and identity management
  • Secure password handling
  • Password reset token generation
  • Random ID and key generation
  • Common helper utilities

Designed for rapid development while maintaining secure and scalable application patterns.


Features

Data

The Data class provides simplified Microsoft SQL Server access utilities using Microsoft.Data.SqlClient.

Features

  • Dynamic SQL query execution
  • Automatic WHERE clause generation
  • Stored procedure support
  • Scalar query execution
  • Parameterized queries
  • SQL injection-safe parameter handling
  • Connection testing
  • Direct SqlConnection access
  • Non-query write operations

Email

The Email class provides SMTP email functionality with support for password reset workflows.

Features

  • SMTP email sending
  • HTML and plain text emails
  • Password reset email templates
  • SMTP authentication
  • SSL/TLS support
  • IConfiguration integration
  • ILogger integration
  • Error handling with TrySend pattern

Configuration Example

{
  "Mail": {
    "FromAddress": "no-reply@yourdomain.com",
    "FromDisplayName": "Your Application"
  },

  "Smtp": {
    "Host": "smtp.yourserver.com",
    "Port": "587",
    "EnableSsl": "true",
    "User": "smtp-user",
    "Password": "smtp-password"
  }
}

Example

var success = email.TrySendPasswordResetEmail(
    "user@domain.com",
    resetLink,
    out var errorMessage
);

Helpers

The Helpers class provides utility methods for generating secure IDs and random keys.

Features

  • Business ID generation
  • Secure random key generation
  • Cryptographically secure randomization

Example

var helpers = new Helpers();

string businessId = helpers.GenerateBusinessId();

string randomKey = helpers.GenerateRandomKey(24);

ID

The Id class provides authentication and identity management functionality.

Features

  • User creation
  • Credential validation
  • Password hashing using PBKDF2-SHA256
  • Password reset token generation
  • Password reset token validation
  • Last login tracking
  • Secure token hashing
  • User lookup by ID or email
  • Password updates
  • Active user validation

Security Features

  • PBKDF2 SHA256 password hashing
  • Cryptographically secure salts
  • Fixed-time password comparison
  • Secure password reset token generation
  • SHA256 token hashing
  • Configurable iteration counts

Installation

Install via NuGet:

dotnet add package Terminalogic.Essentials

Dependency Injection Setup

Program.cs

builder.Services.AddSingleton<Data>();
builder.Services.AddSingleton<Helpers>();
builder.Services.AddSingleton<Id>();
builder.Services.AddSingleton<Email>();

Usage Examples

Reading Data

var table = data.Read(
    "SELECT * FROM Users ORDER BY Id DESC",
    "Email", "admin@domain.com"
);

Executing Stored Procedures

var table = data.Read(
    "EXEC dbo.GetUsers",
    "@IsActive", true
);

Scalar Queries

int count = data.ReadScalar<int>(
    "SELECT COUNT(*) FROM Users",
    null,
    null
);

Writing Data

data.Write(
    "INSERT INTO Users (Email, FirstName) VALUES (@Email, @FirstName)",
    "Email", "admin@domain.com",
    "FirstName", "Admin"
);

Creating Users

var user = id.CreateUser(
    null,
    "admin@domain.com",
    "Password123!",
    "John",
    "Doe",
    true
);

Validating Login Credentials

var user = id.ValidateCredentials(
    "admin@domain.com",
    "Password123!"
);

if (user != null)
{
    // Authenticated
}

Password Reset Tokens

var token = id.CreatePasswordResetToken(
    "admin@domain.com",
    TimeSpan.FromHours(1)
);

Testing Database Connectivity

bool connected = data.TestConnection(
    out var errorMessage
);

Supported Frameworks

  • .NET 8
  • .NET 9
  • ASP.NET Core
  • Razor Pages
  • MVC
  • Web APIs
  • Console Applications
  • Background Services

Architecture Goals

Terminalogic.Essentials was built with the following design principles:

  • Lightweight
  • Minimal boilerplate
  • Secure by default
  • Enterprise-ready
  • Dependency injection friendly
  • Reusable infrastructure
  • Simple APIs
  • Rapid development focused

Security Notes

  • Passwords are hashed using PBKDF2 SHA256
  • Password reset tokens are securely generated
  • SQL parameters are automatically parameterized
  • SMTP credentials should be stored securely
  • Always use HTTPS for password reset links

Namespace

using Terminalogic;

Dependencies

  • Microsoft.Data.SqlClient
  • Microsoft.Extensions.Configuration
  • Microsoft.Extensions.Logging

License

MIT License


Author

Terminalogic

Enterprise Utilities for Modern .NET Applications

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 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. 
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
1.0.6 147 6/23/2026
1.0.5 116 6/23/2026
1.0.4 109 5/15/2026
1.0.3 117 5/11/2026
1.0.2 123 5/11/2026
1.0.1 113 5/10/2026
1.0.0 111 5/10/2026

Initial release