brk.Framework.Utility 1.1.0

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

brk.Framework.Utility

A lightweight .NET utility library that provides commonly used helper classes and extension methods for everyday application development.

The package includes utilities for working with dates, strings, numbers, enums, validation, culture, and reflection, helping reduce boilerplate code across your projects.


Installation

Install the package from NuGet:

dotnet add package brk.Framework.Utility

Or using the NuGet Package Manager:

Install-Package brk.Framework.Utility

Features

  • 📅 Date and time conversion utilities
  • 🇮🇷 Persian (Shamsi) date extensions
  • 🔢 Number formatting and conversion helpers
  • 🔤 String manipulation extensions
  • ✅ Common string validators
  • 📧 Email validation
  • 📱 Mobile number validation
  • 🆔 National ID validation
  • 🏷️ Enum helper extensions
  • 🏛️ Culture helper methods
  • 🔍 Reflection-based attribute helpers

Included Components

DateTimeConverter

Provides helper methods for converting and formatting DateTime values.

Typical use cases:

  • Convert between calendars
  • Date formatting
  • Date parsing
  • Time conversions

PersianDateTimeExtensions

Extension methods for working with the Persian (Solar Hijri) calendar.

Features include:

  • Convert Gregorian to Persian date
  • Convert Persian date to Gregorian
  • Persian date formatting
  • Persian date/time display

EnumExtensions

Extension methods for working with enumerations.

Examples include:

  • Get display name
  • Get description attribute
  • Convert enum to list
  • Parse enum safely

NumberExtensions

Utility methods for numeric values.

Examples:

  • Formatting
  • Rounding
  • Percentage calculations
  • Numeric conversions

StringExtensions

Common string helper methods.

Examples:

  • Null or empty handling
  • Trimming
  • Case conversion
  • String formatting
  • Safe string manipulation

StringValidatorExtensions

Validation helpers for strings.

Examples:

  • IsNumeric
  • IsAlphabetic
  • IsNullOrWhiteSpace
  • Length validation
  • Regular expression helpers

AttributeHelper

Reflection utilities for reading .NET attributes.

Examples:

  • Read custom attributes
  • Get Display attributes
  • Retrieve Description attributes
  • Metadata inspection

CultureHelper

Utilities related to globalization and localization.

Examples:

  • Current culture
  • UI culture
  • Culture conversion
  • Language helpers

EmailValidator

Helper methods for validating email addresses.

Example:

bool valid = EmailValidator.IsValid("john@example.com");

MobileValidator

Provides validation methods for mobile numbers.

Supports:

  • Iran
  • Afghanistan

Example:

bool valid = MobileValidator.IsValid("+989123456789");

NationalIdValidator

Utilities for validating national identification numbers.

Currently supported:

  • Iran National Code

Example:

bool valid = NationalIdValidator.IsValid("1234567890");

Example

using brk.Framework.Utility;

// Email
EmailValidator.IsValid("user@example.com");

// Mobile
MobileValidator.IsValid("+989123456789");

// National ID
NationalIdValidator.IsValid("1234567890");

// Persian Date
var persianDate = DateTime.Now.ToPersianDate();

// Enum
var description = MyEnum.Active.GetDescription();

Target Framework

  • .NET 10+

Why brk.Framework.Utility?

  • Lightweight
  • No unnecessary dependencies
  • Extension-method based API
  • Reusable across multiple projects
  • Production-ready
  • Easy to integrate

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a Pull Request

License

This project is licensed under the MIT License.


Repository

GitHub: https://github.com/mustafa-barakzey/brk.Framework.Utility


Author

Mustafa Barakzey

Senior .NET Developer


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.
  • net10.0

    • No dependencies.

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.1.0 93 9/2/2026
1.0.1 116 7/13/2026
1.0.0 116 7/13/2026