Sisusa.Information
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sisusa.Information --version 1.0.0
NuGet\Install-Package Sisusa.Information -Version 1.0.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="Sisusa.Information" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sisusa.Information --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sisusa.Information, 1.0.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.
// Install Sisusa.Information as a Cake Addin #addin nuget:?package=Sisusa.Information&version=1.0.0 // Install Sisusa.Information as a Cake Tool #tool nuget:?package=Sisusa.Information&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sisusa Information Library
This library provides a comprehensive set of classes for handling various information types, including time, identification, financial, and communication data.
Key Features:
Robust Validation: Strict validation for all input data to ensure data integrity.
Immutability: Most classes are immutable, promoting data consistency and preventing accidental modifications.
Builder Pattern: Provides a fluent API for creating complex objects like addresses and contact information.
Error Handling: Clear and informative exception handling for invalid input or unexpected scenarios.
Core Classes:
Time
Year: Represents a year with validation, comparison, and calculation capabilities.
YearRange: Represents a range of years with inclusion checks and length calculations.
DateRange: Represents a range of dates with inclusion checks and duration calculations.
Identification (Eswatini Specific)
SwaziPin: Parses and validates Eswatini national identification numbers (PINs), extracting date of birth, gender, and serial number.
Financial
Money: Represents a monetary amount with a specific currency. Supports operations like addition, subtraction, multiplication, comparison, and conversion to decimal.
Currency: Enumeration for supported currencies (ZAR, USD, EUR).
IMoneyConverter: Interface for converting money between currencies.
DefaultMoneyConverter: A concrete implementation of IMoneyConverter that uses predefined conversion rates.
Communication
TelephoneNumber: Represents a phone number with country code and phone number.
EswatiniTelNumber: Represents an Eswatini phone number with specific validation rules.
EmailAddress: Represents an email address with validation and parsing capabilities.
DetailedAddress: Represents a detailed address with country, city, street, nearest landmark, and postal code.
ContactInformation: Combines phone number, email address, and physical address into a single class.
Usage:
For a detailed usage guide, refer to the specific class documentation within the library. Here's a basic example:
// Create a Swazi PIN and extract information
SwaziPin pin = SwaziPin.Parse("05071100245");
Console.WriteLine($"Gender: {pin.Gender}");
Console.WriteLine($"Date of Birth: {pin.DateOfBirth}");
// Create a money object and perform calculations
Money amount = Money.FromParts(100, 50, Currency.ZAR);
Money increasedAmount = amount.IncrementByPercent(10);
Console.WriteLine($"Increased amount: {increasedAmount}");
// Create a contact information object
ContactInformation contact = ContactInformation.GetBuilder()
.WithPhoneNumber(TelephoneNumber.FromCountry(268).HavingPhoneNumber(76000000))
.WithEmailAddress(EmailAddress.Parse("john.doe@example.com"))
.AndLocatedAt(DetailedAddress.GetBuilder()
.InTownOrCity("Mbabane")
.WithNearestGeographicalMarker("Times Square")
.Create())
.Build();
Console.WriteLine($"Contact Information: {contact.PhoneNumber}, {contact.EmailAddress}, {contact.PhysicalAddress}");
Additional Notes:
The library promotes a functional programming approach with immutable objects and pure functions.
The validation and error handling mechanisms ensure data integrity and prevent invalid input.
The builder pattern simplifies object creation and promotes a fluent API.
The library is designed to be extensible and customizable to fit various use cases.
For more detailed usage instructions and examples, refer to the specific class documentation within the library.
Product | Versions 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. |
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.