SimplyWorks.PrimitiveTypes 8.1.2

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

SW.PrimitiveTypes

Foundational .NET library with essential types, patterns, and interfaces for modern application development.

Quick Start

dotnet add package SimplyWorks.PrimitiveTypes

What's Included

💎 Value Objects

Ready-to-use business types with built-in validation and conversion:

  • Money - Currency handling with conversion support
  • Weight - Mass measurements (kg, lb, oz, g)
  • Dimensions - 3D measurements with unit conversion
  • StreetAddress - Structured address representation

🏗️ Domain Patterns

Clean architecture building blocks:

  • IEntity<T> - Entity interfaces with identity
  • IAggregateRoot<T> - Domain aggregate markers
  • ISpecification<T> - Business rule specifications
  • ValueObject - Base class with equality semantics

🎯 API Handlers

CQRS-style interfaces for clean APIs:

  • IGetHandler<TKey, TResult> - Query operations
  • ICommandHandler<TRequest, TResult> - Command operations
  • IDeleteHandler<TKey> - Delete operations

🚌 Messaging Contracts

Event-driven architecture interfaces:

  • IPublish / IConsume<T> - Message publishing/consumption
  • IBroadcast / IListen<T> - Event broadcasting/listening

Usage Example

// Value Objects
var price = new Money(99.99m, "USD");
var weight = new Weight(2.5m, WeightUnit.kg);
var size = new Dimensions(30, 20, 10, DimensionUnit.cm);

// Domain Entity
public class Product : IAggregateRoot
{
    public int Id { get; set; }
    public Money Price { get; set; }
    public Weight ShippingWeight { get; set; }
    public Dimensions PackageDimensions { get; set; }
}

// API Handler
public class GetProductHandler : IGetHandler<int, Product>
{
    public async Task<Product> Handle(int id)
    {
        // Retrieve and return product
        return await productRepository.GetByIdAsync(id);
    }
}

Part of the Simplify9 ecosystem:

📚 More Information

📖 View on GitHub →

Visit our GitHub repository for additional examples, source code, and contribution opportunities.


MIT Licensed | Made by Simplify9

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 (22)

Showing the top 5 NuGet packages that depend on SimplyWorks.PrimitiveTypes:

Package Downloads
SimplyWorks.HttpExtensions

A lightweight .NET library providing HTTP extensions for simplified JSON operations, HTTP client helpers, and API client abstractions with JWT support. Includes extensions for HttpContent, HttpClient, HttpClientFactory, and dependency injection setup. See GitHub for full documentation and examples.

SimplyWorks.Bus

A lightweight .NET 8 message bus library built on RabbitMQ for ASP.NET Core applications. Provides simple publish-subscribe patterns, typed consumers, broadcasting, automatic retries, and JWT integration. Visit GitHub for full documentation and examples.

SimplyWorks.EfCoreExtensions

Open-source Entity Framework Core extensions for .NET, including helpers for ChangeTracker, DbContext, IQueryable, and more. See full documentation at https://github.com/simplify9/EfCoreExtensions

SimplyWorks.Serverless.Sdk

SDK for developing .NET serverless adapters with the Runner class, logging utilities, and adapter communication protocols. See https://github.com/simplify9/SW-Serverless for full documentation.

SimplyWorks.Logger

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.1.2 253 9/16/2025
8.1.1 233 9/16/2025
8.1.0 232 9/16/2025
8.0.4 499 7/31/2025
8.0.0 2,566 1/20/2025
6.1.3 5,812 2/5/2024
6.1.1 7,344 7/24/2023
6.1.0 772 7/24/2023
6.0.5 13,996 3/23/2023
6.0.3 3,484 2/27/2023
6.0.1 7,139 2/2/2023
2.0.120 1,380 2/1/2023
2.0.117 13,613 11/15/2022
2.0.113 40,861 10/24/2021
2.0.112 54,877 8/24/2021
2.0.110 7,676 5/9/2021
2.0.108 1,096 4/19/2021
2.0.106 25,498 12/17/2020
2.0.104 17,299 12/6/2020
2.0.102 11,286 11/29/2020
2.0.100 9,351 11/22/2020
2.0.98 2,723 10/28/2020
2.0.96 1,045 10/28/2020
2.0.94 11,861 10/5/2020
2.0.92 1,184 10/5/2020
2.0.90 1,061 10/5/2020
2.0.88 1,078 10/3/2020
2.0.86 2,709 9/30/2020
2.0.84 8,392 9/22/2020
2.0.82 2,962 9/22/2020
2.0.80 1,866 9/21/2020
2.0.78 1,087 9/21/2020
2.0.76 1,537 9/20/2020
2.0.74 1,727 9/20/2020
2.0.72 1,082 9/20/2020
2.0.70 1,155 9/19/2020
2.0.69 2,175 9/17/2020
2.0.67 1,408 9/17/2020
2.0.65 1,467 9/17/2020
2.0.63 1,284 9/17/2020
2.0.61 5,746 9/15/2020
2.0.59 11,560 9/14/2020
2.0.57 1,108 9/14/2020
2.0.55 4,188 9/12/2020
2.0.53 1,255 9/12/2020
2.0.51 2,092 9/10/2020
2.0.50 1,697 9/10/2020
2.0.48 2,982 9/8/2020
2.0.46 1,357 9/8/2020
2.0.44 2,335 9/7/2020
2.0.42 1,946 9/5/2020
2.0.41 13,470 9/4/2020
2.0.39 1,117 9/4/2020
2.0.37 1,689 9/3/2020
2.0.35 1,115 9/3/2020
2.0.33 1,080 9/3/2020
2.0.31 3,952 8/30/2020
2.0.29 1,073 8/30/2020
2.0.26 2,611 8/24/2020
2.0.25 1,092 8/24/2020
2.0.21 3,326 8/21/2020
2.0.19 1,118 8/20/2020
2.0.17 1,092 8/20/2020
2.0.15 1,114 8/20/2020
2.0.12 15,031 8/5/2020
2.0.10 5,944 8/5/2020
2.0.8 1,101 8/5/2020
2.0.6 4,248 8/1/2020
2.0.4 16,571 7/30/2020
1.0.0 1,235 5/30/2020