Maydon.Utilities.Persistence 1.0.3

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

Maydon.Utilities

NuGet Version License

A lightweight and modular collection of reusable utilities, abstractions, and base classes for .NET applications. This project provides the core building blocks for applications following Domain-Driven Design (DDD) principles and modern .NET best practices.

Packages

The toolkit is divided into three focused packages to minimize dependencies:

  1. Maydon.Utilities: Core domain foundations (Result pattern, Entity bases, Domain events).
  2. Maydon.Utilities.Application: Application layer abstractions (CQRS, Messaging, Decorators).
  3. Maydon.Utilities.Persistence: Database infrastructure (Entity Framework Core support, Interceptors).

Features

🏗️ Domain Layer (Maydon.Utilities)

  • Result Pattern: Type-safe error handling with Result<T> and Result types.
  • Entity Base Classes: Rich entity base class with domain events, audit fields, and soft delete support.
  • Domain Events: Event-driven architecture support with IDomainEvent and publication markers.
  • Value Objects: Foundational support for DDD value objects.

🚀 Application Layer (Maydon.Utilities.Application)

  • CQRS Infrastructure: ICommand, IQuery, and their respective handlers.
  • Decorators: Built-in support for Logging and Validation decorators.
  • Pagination: Strongly-typed PagedList<T> and query support.

💾 Persistence Layer (Maydon.Utilities.Persistence)

  • EF Core Interceptors: Automatic handling of Audit, Soft Delete, and Domain Event publication.
  • Database Migrators: Unified interface for applying pending migrations.

Installation

Install the core package via NuGet:

dotnet add package Maydon.Utilities

For application and persistence support:

dotnet add package Maydon.Utilities.Application
dotnet add package Maydon.Utilities.Persistence

Quick Start

Result Pattern

using Maydon.Utilities.Results;

public Result<User> GetUser(Guid id)
{
    var user = _repository.Get(id);
    return user is not null 
        ? user 
        : Result.Failure<User>(Error.NotFound("User.NotFound", "User not found"));
}

Domain Entities

using Maydon.Utilities.Entities;

public class Product : Entity
{
    public string Name { get; set; }
    
    public void UpdateName(string newName)
    {
        Name = newName;
        AddDomainEvent(new NameUpdatedEvent(Id, newName));
    }
}

Requirements

  • .NET 10.0 or later

License

This project is licensed under the MIT License - see the LICENSE file for details.

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.3 200 12/23/2025
1.0.2 193 12/23/2025
1.0.0 193 12/23/2025