Modrich.Abstractions 0.1.0

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

Modrich.Abstractions

Tier 1 contracts for the Modrich modular foundation for .NET 10. Module authors and host authors both depend on this package; nothing in it pulls EF Core, MVC, or any concrete framework beyond Microsoft.AspNetCore.App.

What's in the box

  • Module contracts
    • IModule — base interface (Name, optional Permissions).
    • IApiModule — adds RegisterApiDependencies(IServiceCollection, IConfiguration).
    • IAppModule — adds RegisterAppDependencies(...), optional ConfigureAppPipeline(WebApplication) and MapAppEndpoints(IEndpointRouteBuilder) hooks.
  • Discovery marker
    • [assembly: ModuleAssembly] (ModuleAssemblyAttribute) — opts a module assembly into host discovery. Apply once per module assembly.
  • Persistence hooks
    • IModuleMigratorOrder, MigrateAsync(IServiceProvider).
    • IModuleSeederOrder, SeedAsync(IServiceProvider).
  • Registry
    • IModuleRegistry / ModuleDescriptor(Name, Permissions) — read-only catalog of discovered modules.
    • ModuleEntry — optional per-module config (ApiBaseUrl).
  • Layout slots
    • LayoutSectionsTopLeft, TopRight, SidebarTop, SidebarBottom, Footer.
    • IModuleLayoutWidget / ModuleLayoutWidget(Type) — register a component the host renders via <DynamicComponent>.

Install

dotnet add package Modrich.Abstractions

Usage — declare an API module

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Modrich.Modules;

[assembly: ModuleAssembly]

namespace Acme.Orders;

public sealed class OrdersApiModule : IApiModule
{
    public string Name => "Orders";

    public IEnumerable<string> Permissions => ["Orders.View", "Orders.Edit"];

    public void RegisterApiDependencies(IServiceCollection services, IConfiguration configuration)
    {
        services.AddScoped<IOrderService, OrderService>();
    }
}

Usage — declare an App (UI) module

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Modrich.Modules;

[assembly: ModuleAssembly]

namespace Acme.Orders.Web;

public sealed class OrdersAppModule : IAppModule
{
    public string Name => "Orders";

    public void RegisterAppDependencies(IServiceCollection services, IConfiguration configuration, string? apiBaseUrl = null)
    {
        services.AddRefitClient<IOrdersApi>()
                .ConfigureHttpClient(c => c.BaseAddress = new Uri(apiBaseUrl!));
    }

    public void ConfigureAppPipeline(WebApplication app) { /* optional */ }

    public void MapAppEndpoints(IEndpointRouteBuilder endpoints) { /* optional */ }
}

Usage — module-owned EF migrations and seed data

public sealed class OrdersMigrator : IModuleMigrator
{
    public int Order => 100;

    public async Task MigrateAsync(IServiceProvider services)
    {
        var db = services.GetRequiredService<OrdersDbContext>();
        await db.Database.MigrateAsync();
    }
}

public sealed class OrdersSeeder : IModuleSeeder
{
    public int Order => 100;

    public Task SeedAsync(IServiceProvider services) => Task.CompletedTask;
}

The host runs every IModuleMigrator then every IModuleSeeder in ascending Order. See Modrich.Persistence.

Versioning

Strict semver. No breaking changes within a major version — modules built against vN.x must keep loading against vN.y where y > x. EnablePackageValidation is on.

  • Modrich.Modularity — discovery + DI registration pipeline that consumes these contracts.
  • Gatekeep.Authorization.Abstractions — permission contracts referenced by IModule.Permissions.
  • Modrich.Sdk.Api / Modrich.Sdk.Web — meta-packages that pull this in for module authors.

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

Showing the top 3 NuGet packages that depend on Modrich.Abstractions:

Package Downloads
Modrich.Modularity

Package Description

Modrich.Sdk.Web

Package Description

Modrich.Sdk.Api

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 121 5/23/2026
0.0.1 124 5/23/2026