Noayo.Domain 0.0.1

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

Noayo

NuGet CI License: MIT

Noayo (from French noyau, "core" or "kernel") is a family of lightweight .NET class libraries that provide foundational building blocks for domain modelling and infrastructure wiring in line-of-business applications.

Packages

Package Description
Noayo.Domain Dependency-free core: entity identity, auditing, timestamps, soft deletion, paged results
Noayo.Domain.EntityFrameworkCore EF Core interceptors and model-builder helpers (planned)
Noayo.Domain.FastEndpoints FastEndpoints ICommandMiddleware integrations (planned)
Noayo.Domain.AspNetCore Default ICurrentUserAccessor over IHttpContextAccessor (planned)

Install

dotnet add package Noayo.Domain

Target Frameworks: net8.0, net9.0

Quick Start

Define an entity

using Noayo.Domain.Auditing;
using Noayo.Domain.Entities;
using Noayo.Domain.SoftDeletion;

public class Customer
    : IEntity<Guid>, IAuditable, IAuditable<Guid>, ITimeStamped, ISoftDeletable<Guid>
{
    public Guid Id { get; set; }

    // IAuditable — display names
    public string? CreatedBy { get; set; }
    public string? UpdatedBy { get; set; }

    // IAuditable<Guid> — typed FK
    public Guid? CreatedByUserId { get; set; }
    public Guid? UpdatedByUserId { get; set; }

    // ITimeStamped
    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }

    // ISoftDeletable<Guid>
    public bool IsDeleted { get; set; }
    public DateTime? DeletedAt { get; set; }
    public string? DeletedBy { get; set; }
    public Guid? DeletedByUserId { get; set; }

    // Domain properties
    public string Name { get; set; } = string.Empty;
}

Return a paged result

using Noayo.Domain.Paging;

PagedResult<Customer> result = new(
    items: customers,
    pageNumber: 1,
    pageSize: 20,
    totalCount: 150);

Console.WriteLine($"Page {result.PageNumber} of {result.TotalPages}");
Console.WriteLine($"Has next page: {result.HasNextPage}");

Attribute-based opt-in

using Noayo.Domain.Attributes;

[Audited]
[SoftDeleted]
public class CreateCustomerCommand { /* … */ }

Infrastructure code (e.g. an EF Core SaveChangesInterceptor) can use [Audited] as a convention-based alternative to implementing IAuditable + ITimeStamped, and [SoftDeleted] as an alternative to ISoftDeletable.

IAuditContext seam

IAuditContext is the dependency-free contract between the request pipeline and the persistence layer:

// Request pipeline (e.g. FastEndpoints middleware) sets the flags:
auditContext.AuditEnabled = true;
auditContext.SoftDeleteEnabled = true;

// Persistence interceptor reads them during SaveChanges.

Register AuditContext as scoped in your DI container:

services.AddScoped<IAuditContext, AuditContext>();

Companion Packages (Planned)

Behavior implied by the interfaces is wired up in separate packages, each depending only on Noayo.Domain plus the one framework it integrates with:

  • Noayo.Domain.EntityFrameworkCore — AuditSaveChangesInterceptor, SoftDeleteSaveChangesInterceptor, ApplySoftDeleteQueryFilters(), ToPagedResultAsync().
  • Noayo.Domain.FastEndpoints — AuditMiddleware<TRequest, TResponse> that reads [Audited]/[SoftDeleted] attributes and sets flags on the scoped IAuditContext.
  • Noayo.Domain.AspNetCore — Default ICurrentUserAccessor backed by IHttpContextAccessor.

License

MIT

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.
  • net10.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.

Version Downloads Last Updated
0.0.1 134 5/23/2026