Arhimede.Lib 1.0.11

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

Arhimede.Lib

Utility library for .NET applications with helpers for string processing, period formatting, validation, object cloning, diff models, and email sending.

Target framework

  • .NET 10 (net10.0)

Package dependencies

  • MailKit
  • Microsoft.Extensions.Configuration
  • Microsoft.Extensions.Options

Features

  • General utility methods in Biblio
  • Period formatting helpers in Perioade
  • Validation attributes for IBAN and SSN/VAT values
  • JSON-based object cloning extension
  • Email sending support with MailKit
  • DI registration helper for library services
  • Simple diff result models

Main components

Biblio

Biblio contains a large set of helper methods. From the currently exposed code, common examples include:

  • TrimWhiteSpaces(object obj) - trims all string properties on an object
  • StrExtract(...) - extracts substrings between delimiters
  • At(...) - finds string positions
  • validation helpers used by the custom attributes

Example:

using Arhimede;

var person = new Person
{
    FirstName = "  John  ",
    LastName = "  Doe  "
};

Biblio.TrimWhiteSpaces(person);

Validation attributes

The library includes:

  • IBANAttribute
  • SSNAttribute

Example:

using Arhimede.Attributes;
using System.ComponentModel.DataAnnotations;

public class CustomerInput
{
    [IBAN]
    public string? Iban { get; set; }

    [SSN]
    public string? PersonalOrVatNumber { get; set; }
}

SystemExtension.Clone<T>()

Provides a simple deep-clone style helper via JSON serialization.

Example:

using Arhimede;

var cloned = original.Clone();

Perioade

Perioade provides Romanian text formatting for date intervals through TextPer(DateTime datai, DateTime dataf, bool abreviat = false).

It can format:

  • a single day
  • a date range within the same month
  • a full month
  • a full quarter
  • a full semester
  • a full year
  • cross-month and cross-year intervals

Examples:

using Arhimede.Biblio;

result = TextPer(new DateTime(2024, 1, 1), new DateTime(2024, 1, 31), true);
// "ian. 2024"
result = TextPer(new DateTime(2024, 1, 1), new DateTime(2024, 3, 31), true);
// "2024 Trim.1"
result = TextPer(new DateTime(2024, 1, 1), new DateTime(2024, 6, 30), false);
// "2024 Semestrul 1"
result = TextPer(new DateTime(2024, 2, 10), new DateTime(2024, 2, 20), true);
// "10-20.02.2024"

Email support

Models

EmailConfiguration

public class EmailConfiguration
{
    public string From { get; set; }
    public string SmtpServer { get; set; }
    public int Port { get; set; }
    public string UserName { get; set; }
    public string Password { get; set; }
}

Message

var message = new Message(
    new[] { "recipient@example.com" },
    "Test subject",
    "Email body"
);

Registering services

The library exposes an extension method for dependency injection:

using Arhimede;

services.AddLibServices();

This registers:

  • IEmailService → EmailService

Sending email

Example:

using Arhimede.Email;
using Arhimede.Models;

var emailConfig = new EmailConfiguration
{
    From = "sender@example.com",
    SmtpServer = "smtp.example.com",
    Port = 465,
    UserName = "sender@example.com",
    Password = "your-password"
};

var service = new EmailService(emailConfig);

var message = new Message(
    new[] { "receiver@example.com" },
    "Hello",
    "This is a test email."
);

service.SendEmail(message);

Diff models

The library currently exposes:

  • Difference
  • DiffResults

These can be used to represent property-level comparison results in higher-level application code.

Installation

If you reference the project directly:

<ProjectReference Include="Arhimede.Lib.csproj" />

If you publish it as a NuGet package, add the package reference normally in your consuming project.

Notes

  • Clone<T>() relies on System.Text.Json serialization.
  • EmailService expects a valid EmailConfiguration instance.
  • AddLibServices() registers the email service, but the configuration object must still be provided by the consuming application.

License

This repository includes LICENSE.txt.

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.

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.0.11 138 5/25/2026
1.0.10 124 5/18/2026
1.0.9 126 5/6/2026
1.0.8 111 5/6/2026
1.0.7 116 5/6/2026
1.0.6 110 5/6/2026
1.0.5 128 4/8/2026
1.0.4 314 4/29/2025
1.0.3 289 4/9/2024
1.0.2 277 2/12/2024
1.0.1 483 4/18/2022
1.0.0 409 4/18/2022