# Discover PosInformatique.Foundations 1.0.0: A Comprehensive Overview

Today I am releasing [**PosInformatique.Foundations**](https://github.com/PosInformatique/PosInformatique.Foundations/) **1.0.0**: a set of small, focused .NET libraries that I use every day in my projects, and that are now available as [NuGet packages](https://www.nuget.org/packages?q=PosInformatique.Foundations).

This project was born from a very simple frustration:

* I was tired of **recreating the same basic value objects** (email, phone number, names, MIME types, etc.) in every project.
    
* I wanted to **standardize data** across applications instead of having a different string format and validation rule in each solution.
    
* I did not want to create a huge “framework” or “super library” that you install for **one useful type** and then carry hundreds of classes you never use.
    

So instead, I decided to build a set of **small, independent libraries**, each one doing **one thing well**, and all following the same philosophy.

## Philosophy: Small, Focused and Standards-Based

[PosInformatique.Foundations](https://github.com/PosInformatique/PosInformatique.Foundations) is not a framework. It is a **toolbox of tiny building blocks**:

* **Granular**: each package is **independent, lightweight, minimal**.
    
* **Composable**: you install **only what you need**.
    
* **Practical**: most packages are about **value objects**, helpers, and small utilities that are missing in many projects.
    
* **Standards-based**: whenever possible, implementations follow existing standards:
    
    * Email addresses: **RFC 5322**
        
    * Phone numbers: **E.164**
        
    * MIME types: **IANA** media types
        
* **Integration-specific packages**: instead of making the core value object depend on everything, I provide **derived packages** per technology:
    
    * [DataAnnotations](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations)
        
    * [FluentValidation](https://fluentvalidation.net/)
        
    * [Entity Framework Core](https://learn.microsoft.com/en-us/ef/core/)
        
    * [System.Text.Json](https://learn.microsoft.com/en-us/dotnet/api/system.text.json)
        
    * etc.
        

You can use the core value objects alone, or plug them into Entity Framework Core, validation, or JSON serialization with the packages you need.

All libraries target **.NET 8.0**, **.NET 9.0** and **.NET 10.0**.

## Main Features in 1.0.0

### Email Address Value Object

Package: [PosInformatique.Foundations.EmailAddresses](https://www.nuget.org/packages/PosInformatique.Foundations.EmailAddresses)  
Plus integrations: [EF Core](https://www.nuget.org/packages/PosInformatique.Foundations.EmailAddresses.EntityFramework), [FluentValidation](https://www.nuget.org/packages/PosInformatique.Foundations.EmailAddresses.FluentValidation), [System.Text.Json](https://www.nuget.org/packages/PosInformatique.Foundations.EmailAddresses.Json).

This package provides a **strongly-typed** `EmailAddress` value object with:

* Validation based on **RFC 5322**
    
* Normalization (for example on casing of the local and domain parts)
    
* Equality and comparison on the normalized form
    

Why it helps:

* No more `string` email arguments everywhere.
    
* You avoid inconsistent regexes and ad-hoc checks in each project.
    
* You can share a standard, tested implementation across many solutions.
    

### Phone Number Value Object (E.164)

Package: [PosInformatique.Foundations.PhoneNumbers](https://www.nuget.org/packages/PosInformatique.Foundations.PhoneNumbers)  
Plus integrations: [EF Core](https://www.nuget.org/packages/PosInformatique.Foundations.PhoneNumbers.EntityFramework), [FluentValidation](https://www.nuget.org/packages/PosInformatique.Foundations.PhoneNumbers.FluentValidation), [System.Text.Json](https://www.nuget.org/packages/PosInformatique.Foundations.PhoneNumbers.Json).

The `PhoneNumber` value object represents numbers in **E.164 format**:

* Parsing with region-aware support for local numbers
    
* Validation and normalization to a single, canonical form
    
* Helpers for formatting and comparison
    

This gives you **consistent phone numbers** across your system:

* One normalized representation
    
* Easier matching and comparisons
    
* No more half-baked "+33" vs "0033" vs local format issues
    

### First/Last Name Value Objects

Package: [PosInformatique.Foundations.People](https://www.nuget.org/packages/PosInformatique.Foundations.People)  
Plus integrations: [DataAnnotations](https://www.nuget.org/packages/PosInformatique.Foundations.People.DataAnnotations), [FluentValidation](https://www.nuget.org/packages/PosInformatique.Foundations.People.FluentValidation), [FluentAssertions](https://www.nuget.org/packages/PosInformatique.Foundations.People.FluentAssertions), [EF Core](https://www.nuget.org/packages/PosInformatique.Foundations.People.EntityFramework), [System.Text.Json](https://www.nuget.org/packages/PosInformatique.Foundations.People.Json).

These packages provide:

* `FirstName` and `LastName` value objects with normalization and validation
    
* Integration with:
    
    * **DataAnnotations** for ASP.NET MVC / Blazor forms
        
    * **FluentValidation** for more advanced validation rules
        
    * **Entity Framework Core** for persistence
        
    * **System.Text.Json** for serialization
        

Goal: stop using raw strings for user names and apply **shared rules** across your application with the following conventions:

* The last name are in uppercase and allows only one space as separator and alphabetic characters.
    
* The first name starts with uppercase and the letters are in lower case. The hypen and one spaces are allowed for separators.
    

### MimeType Value Object

Package: [PosInformatique.Foundations.MediaTypes](https://www.nuget.org/packages/PosInformatique.Foundations.MediaTypes)  
Plus integrations: [EF Core](https://www.nuget.org/packages/PosInformatique.Foundations.MediaTypes.EntityFramework), [System.Text.Json](https://www.nuget.org/packages/PosInformatique.Foundations.MediaTypes.Json).

`MimeType` is an immutable value object that represents a media type like `image/png` or `application/pdf`, with:

* A list of well-known MIME types
    
* Helpers to map between extensions and media types
    
* Strong typing instead of `string` everywhere
    
* Functional helpers to determine if a MIME type is an image, Auto CAD drawing,…
    

### Text Templating: Building Emails (and More) From Models

Emailing is a **simple but essential** feature in almost every application. I wanted a way to:

* Define **strongly-typed email templates** with a model
    
* Use different templating engines (Razor, Scriban, …)
    
* Keep the email sending logic **decoupled** from the rendering engine
    

This is why I introduced two building blocks:

1. **Text templating abstractions**
    
    * Package: [PosInformatique.Foundations.Text.Templating](https://www.nuget.org/packages/PosInformatique.Foundations.Text.Templating)
        
    * Provides:
        
        * `TextTemplate<TModel>` base class
            
        * `ITextTemplateRenderContext`
            
    * Idea: define a clear contract for “take a model and render text”.
        
2. **Concrete implementations**
    
    * [PosInformatique.Foundations.Text.Templating.Razor](https://www.nuget.org/packages/PosInformatique.Foundations.Text.Templating.Razor)
        
        * Razor-based templating using Blazor components
            
        * Strongly-typed models
            
        * Full dependency injection support
            
    * [PosInformatique.Foundations.Text.Templating.Scriban](https://www.nuget.org/packages/PosInformatique.Foundations.Text.Templating.Scriban)
        
        * Scriban-based templating with mustache-style syntax
            
        * Strongly-typed models mapped to template data
            

On top of that, there is an **emailing infrastructure**:

* [PosInformatique.Foundations.Emailing](https://www.nuget.org/packages/PosInformatique.Foundations.Emailing)
    
* Plus providers:
    
    * [PosInformatique.Foundations.Emailing.Azure](https://www.nuget.org/packages/PosInformatique.Foundations.Emailing.Azure) (Azure Communication Service)
        
    * [PosInformatique.Foundations.Emailing.Graph](https://www.nuget.org/packages/PosInformatique.Foundations.Emailing.Graph) (Microsoft Graph API)
        

You can:

* Register **email templates** (subject + body) as text templates
    
* Render them from a model (e.g., `PasswordResetModel`, `WelcomeUserModel`, etc.)
    
* Send them via a chosen provider
    

The **nice part** is that this text templating mechanism is **generic**. It is not limited to emails:

* You can reuse it to generate:
    
    * SMS content
        
    * Notifications
        
    * System messages
        
    * Any other text-based messages from a model
        

## Why Not One Big Library?

I intentionally avoid a single “mega package” that does everything.

Instead:

* Each package has a **single responsibility**.
    
* There is **no hard coupling** between them (only logical relationships).
    
* You choose:
    
    * Only the value objects you need (email, phone, names, MIME types, …)
        
    * Only the integrations you need (EF, JSON, validation, …)
        
    * Only the emailing pieces you actually use.
        

This keeps your dependencies clean and your binaries smaller, and it avoids installing 98% of unused code **just for one class**. Also, because the library are very small, you can use it in Blazor WASM applications which requires binaries as small as possible for the startup of the application.

## .NET Compatibility And Dependencies

All [PosInformatique.Foundations](https://www.nuget.org/packages?q=PosInformatique.Foundations) packages target:

* **.NET 8.0**
    
* **.NET 9.0**
    
* **.NET 10.0**
    

For external dependencies, I intentionally target **relatively old versions** (for example [Microsoft.Graph](https://www.nuget.org/packages/Microsoft.Graph)) to stay compatible with more projects.

If you need newer versions in your solution, you can simply:

* Add an explicit reference to the newer dependency in your application
    
* Let NuGet resolve the latest version for that library
    
* Still use [PosInformatique.Foundations](https://www.nuget.org/packages?q=PosInformatique.Foundations) without issues
    

This approach keeps the libraries flexible and avoids forcing a full update of your stack.

## Real-World Usage

These libraries are not theoretical. I built them to solve real problems in real applications.

[PosInformatique.Foundations](https://github.com/PosInformatique/PosInformatique.Foundations) is currently used in the development of **SaaS applications** at:

* [Chantier Connect](https://www.chantier-connect.com/): A 360° application for desktop, tablet, and phone, and a kiosk to track the progress of construction sites.
    
* [Artahe Solutions](https://www.artahe-solutions.com/): A software editor that allows the creation of activity tracking reports.
    

The goal is to reuse the same reliable building blocks across multiple products, rather than copy-pasting the same pieces of code again and again.

## Getting Started

All packages are available on NuGet.  
The full list is in the GitHub repository: [PosInformatique.Foundations](https://github.com/PosInformatique/PosInformatique.Foundations)

From there you can:

* Browse each package README
    
* Copy installation commands
    
* See examples, supported scenarios, and integration details
    

## Conclusion

[PosInformatique.Foundations](https://www.nuget.org/packages?q=PosInformatique.Foundations) is my attempt to provide **simple, reusable .NET foundations** for everyday work:

* Strongly-typed value objects for **email**, **phone numbers**, **names**, **MIME types**
    
* A clean **text templating** abstraction
    
* A flexible **emailing** infrastructure
    
* Small, modular packages instead of one big framework
    
* Based on **standards** and compatible with **.NET 8–10**
    

If you are a .NET developer who is tired of rewriting the same value objects and basic infrastructure, I hope these libraries will save you time and bring more consistency to your projects.

If you try them, I would be happy to hear your feedback and suggestions for future improvements.
