Egypt.Net.Core 0.2.0

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

Egypt.Net.Core 🇪🇬

Core domain utilities for working with Egyptian national data in .NET.

This library provides clean, immutable, and well-tested domain models for common Egyptian data concepts, starting with the Egyptian National ID.


Why this library exists

Most .NET examples focus on global or Western data models. Egyptian developers often reimplement the same logic (such as parsing the national ID) in ad-hoc and error-prone ways.

This library exists to:

  • Provide a clean and reusable core domain model
  • Encourage correct validation and domain boundaries
  • Serve as an educational reference for beginners
  • Grow gradually through real Egyptian use cases

Features

  • Parse and validate Egyptian National ID
  • Extract birth date
  • Determine gender
  • Resolve governorate
  • Calculate age and adulthood
  • Clean and immutable domain model
  • Domain-specific exception hierarchy
  • Safe creation via TryCreate
  • Quick validation via IsValid
  • No external dependencies
  • Fully unit tested

Installation

Available on NuGet:

dotnet add package Egypt.Net.Core

Usage

using Egypt.Net.Core;

var nationalId = new EgyptianNationalId("30101010123456");

Console.WriteLine(nationalId.BirthDate);    // 2001-01-01
Console.WriteLine(nationalId.Gender);       // Male
Console.WriteLine(nationalId.Governorate);  // Cairo
Console.WriteLine(nationalId.IsAdult);      // true
using Egypt.Net.Core;

if (EgyptianNationalId.TryCreate("30101010123456", out var nationalId))
{
    Console.WriteLine(nationalId!.Gender);
}
else
{
    Console.WriteLine("Invalid National ID");
}

Quick Validation

bool isValid = EgyptianNationalId.IsValid("30101010123456");

Versioning

This library follows semantic versioning:

  • 0.x.x → Public API may change
  • 1.0.0 → Stable API

Project Status

This project is under active development. New features will be added gradually with a strong focus on correctness and clarity.

License

This project is licensed under the MIT License.

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.
  • net8.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 115 2/18/2026
1.0.1 159 1/29/2026
1.0.0 97 1/27/2026
0.2.0 100 1/27/2026
0.1.1 100 1/24/2026
0.1.0 100 1/23/2026