Azunt 1.2.4

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

Azunt.dll

Azunt.dll is a general-purpose .NET utility library for reusable application building blocks such as validation, date/time helpers, media type resolution, identifier utilities, repository abstractions, and service contracts.

It is designed to help reduce duplicate code across ASP.NET Core, Blazor, MVC, Razor Pages, Web API, and other .NET applications.

Target Framework

  • .NET Standard 2.0

This makes Azunt broadly compatible with many modern .NET applications.

Package Highlights

Azunt provides reusable helpers and abstractions in areas such as:

  • Validation helpers
  • Date and time formatting helpers
  • MIME/content-type resolution
  • Identifier and number utilities
  • Repository abstractions
  • Service interfaces for email, SMS, and storage
  • Common enums and shared models

Installation

Install via NuGet:

dotnet add package Azunt

Or via Package Manager Console:

Install-Package Azunt

Azunt is best used as a shared utility library across multiple applications and modules.

Typical usage scenarios:

  • ASP.NET Core MVC applications
  • Razor Pages applications
  • Blazor Server applications
  • Web API projects
  • Shared library projects

Namespace Overview

Common namespaces include:

  • Azunt.Utilities.DateTimes
  • Azunt.Utilities.Validation
  • Azunt.Utilities.Media
  • Azunt.Utilities.Identifiers
  • Azunt.Repositories
  • Azunt.Services
  • Azunt.Services.Interfaces
  • Azunt.Models.Enums

Quick Start

Date and Time Helpers

using Azunt.Utilities.DateTimes;

var nowText = DateTimeUtility.ShowTimeOrDate(DateTime.Now);
var dateText = DateTimeUtility.ShowDate(DateTime.Now);
var agoText = DateTimeUtility.TimeAgo(DateTime.Now.AddMinutes(-10), useKorean: true);

Validation Helpers

using Azunt.Utilities.Validation;

bool validUserName = UsernameValidator.IsValid("visualacademy");
bool validEmail = EmailValidator.IsValid("user@example.com");
bool validPassword = PasswordValidator.IsValid("P@ssw0rd!");

File Media Type Resolver

using Azunt.Utilities.Media;

var pdfType = FileMediaTypeResolver.GetMediaType("report.pdf");
var pngType = FileMediaTypeResolver.GetMediaType(".png");

if (FileMediaTypeResolver.TryGetMediaType(".xlsx", out var mediaType))
{
    // Use mediaType here
}

License Number Utility

LicenseNumberUtility helps increment the trailing numeric portion of a license or identifier string.

Examples:

  • 1234 → 1235
  • LN-1234 → LN-1235
  • 2026-LN-1234 → 2026-LN-1235

If the input is null, empty, whitespace, or does not end with digits, it returns string.Empty.

using Azunt.Utilities.Identifiers;

var next1 = LicenseNumberUtility.GetNext("1234");           // 1235
var next2 = LicenseNumberUtility.GetNext("LN-1234");        // LN-1235
var next3 = LicenseNumberUtility.GetNext("2026-LN-1234");   // 2026-LN-1235
var next4 = LicenseNumberUtility.GetNext("LN-0099");        // LN-0100
var next5 = LicenseNumberUtility.GetNext("ABC");            // ""

This utility is useful when:

  • generating the next visible license number
  • preserving a prefix while incrementing the last number
  • scanning previous employee/license records to determine the next available number

Repository Abstractions

IRepositoryBase<T, TId>

IRepositoryBase<T, TId> is a generic repository abstraction for basic CRUD operations across the Azunt ecosystem.

using System.Collections.Generic;
using System.Threading.Tasks;

namespace Azunt.Repositories
{
    public interface IRepositoryBase<T, TId> where T : class
    {
        Task<T> AddAsync(T entity);
        Task<IEnumerable<T>> GetAllAsync();
        Task<T> GetByIdAsync(TId id);
        Task<bool> UpdateAsync(T entity);
        Task<bool> DeleteAsync(TId id);
    }
}

Use this interface when you want to standardize data access patterns across modules.


Service Interfaces

Azunt includes reusable service contracts for common integration points.

IEmailSender

Task SendEmailAsync(string email, string subject, string message, bool isBodyHtml = true);

Namespace:

Azunt.Services

ITwilioSender

Task SendSmsAsync(string phoneNumber, string message);

Namespace:

Azunt.Services

ISmsSender

Task SendSmsAsync(string number, string message);

Namespace:

Azunt.Services

IStorageServiceBase

Used to abstract file and directory management logic.

Examples of supported responsibilities:

  • create/delete directories
  • upload/download files
  • retrieve metadata
  • generate folder paths

Verification

ManageMessageId

ManageMessageId is an enum used to represent account-management result states in a strongly typed manner.

Examples include:

  • AddPhoneSuccess
  • AddLoginSuccess
  • ChangePasswordSuccess
  • SetTwoFactorSuccess
  • SetPasswordSuccess
  • RemoveLoginSuccess
  • RemovePhoneSuccess
  • Error

Namespace:

Azunt.Models.Enums

Validators

UsernameValidator

Validates whether a username contains disallowed characters.

bool isValid = UsernameValidator.IsValid("myusername");

Disallowed characters include:

  • \
  • /
  • :
  • ?
  • *
  • "
  • <
  • >
  • |
  • space
  • '
  • %
  • &
  • +

EmailValidator

Performs simple regex-based email validation.

bool isValid = EmailValidator.IsValid("user@example.com");

PasswordValidator

Checks whether a password satisfies common security rules:

  • at least 8 characters
  • at least one uppercase letter
  • at least one lowercase letter
  • at least one number
  • at least one special character
bool isValid = PasswordValidator.IsValid("P@ssw0rd!");

File to MIME Type Mapping Guide

Azunt.Utilities.Media.FileMediaTypeResolver returns the appropriate MIME type from a file name or extension.

Basic Example

using Azunt.Utilities.Media;

var mediaType1 = FileMediaTypeResolver.GetMediaType("report.pdf");
var mediaType2 = FileMediaTypeResolver.GetMediaType(".png");
var fallback = FileMediaTypeResolver.GetMediaType("archive.unknown", "application/octet-stream");

ASP.NET Core Controller Example

using Azunt.Utilities.Media;

public async Task<IActionResult> Download(string filePath, string fileName)
{
    var mediaType = FileMediaTypeResolver.GetMediaType(fileName);
    var bytes = await System.IO.File.ReadAllBytesAsync(filePath);
    return File(bytes, mediaType, fileName);
}

Streaming Example

using Azunt.Utilities.Media;

public IActionResult DownloadStream(string filePath, string fileName)
{
    var mediaType = FileMediaTypeResolver.GetMediaType(fileName);
    var stream = System.IO.File.OpenRead(filePath);
    return File(stream, mediaType, fileName);
}

Design Notes

Azunt focuses on:

  • simple APIs
  • low ceremony
  • reusable helpers
  • wide compatibility through .NET Standard 2.0
  • easy adoption in existing enterprise applications

The library is intended to be practical rather than overly abstract.


Testing

Azunt includes MSTest-based test coverage for utility classes.

Typical test coverage areas include:

  • date and time formatting
  • relative time helpers
  • return URL normalization
  • identifier increment logic such as LicenseNumberUtility

When adding a new utility, adding a corresponding test class is recommended.


Versioning

Azunt follows package version updates through the project file.

Example:

<VersionPrefix>1.2.3</VersionPrefix>

Project Notes

In earlier VisualAcademy solution examples, a separate All project was sometimes created and referenced from a web application for shared code usage. That setup was useful during early development and demonstrations, but the recommended long-term direction is to consume Azunt directly as a reusable package.


Contributing

Contributions are welcome.

Recommended contribution flow:

  1. Add or update the utility/service/interface
  2. Add or update tests
  3. Update the README when public-facing functionality changes
  4. Keep APIs simple and easy to understand

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (28)

Showing the top 5 NuGet packages that depend on Azunt:

Package Downloads
Azunt.ResourceManagement

Azunt.ResourceManagement is a reusable .NET module for managing hierarchical resources in multi-tenant applications. Supports SQL Server via EF Core, Dapper, and ADO.NET.

Azunt.FileManagement

Azunt.FileManagement is a reusable .NET module for managing file uploads and downloads with support for EF Core, Dapper, ADO.NET, Excel export, and both local and Azure Blob Storage.

Azunt.ReasonManagement

Azunt.ReasonManagement is a reusable .NET module for managing reason names and contents. It supports EF Core In-Memory for quick Blazor Server testing and SQL Server through EF Core, Dapper, and ADO.NET for production scenarios. Excel export uses Microsoft Open XML SDK instead of EPPlus.

Azunt.EmployeeManagement

Azunt.EmployeeManagement is a reusable .NET module for managing employee information in multi-tenant systems. It provides essential DTOs and integration points for Blazor, EF Core, Dapper, and ADO.NET.

Azunt.BackgroundCheckManagement

Azunt.BackgroundCheckManagement is a reusable .NET module for managing backgroundChecks in multi-tenant systems. It supports SQL Server and is designed for extensibility with EF Core, Dapper, and ADO.NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.4 103 10/6/2026
1.2.3 567 4/3/2026
1.2.2 303 2/16/2026
1.2.1 164 2/3/2026
1.2.0 141 2/2/2026
1.1.9 411 10/10/2025
1.1.8 294 10/5/2025
1.1.7 555 8/20/2025
1.1.6 248 8/20/2025
1.1.5 254 8/17/2025
1.1.4 405 8/6/2025
1.1.3 521 6/19/2025
1.1.2 416 6/1/2025
1.1.1 459 5/27/2025
1.1.0 285 5/22/2025
1.0.9 251 5/20/2025
1.0.8 306 5/19/2025
1.0.7 385 5/9/2025
1.0.6 336 5/5/2025
1.0.5 264 5/4/2025
Loading failed