Terminalogic.Essentials
1.0.0
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
<PackageReference Include="Terminalogic.Essentials" Version="1.0.0" />
<PackageVersion Include="Terminalogic.Essentials" Version="1.0.0" />
<PackageReference Include="Terminalogic.Essentials" />
paket add Terminalogic.Essentials --version 1.0.0
#r "nuget: Terminalogic.Essentials, 1.0.0"
#:package Terminalogic.Essentials@1.0.0
#addin nuget:?package=Terminalogic.Essentials&version=1.0.0
#tool nuget:?package=Terminalogic.Essentials&version=1.0.0
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
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 | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.26)
- Microsoft.Data.SqlClient (>= 5.2.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release