Phymnary.SugarPot.DependencyInjection 1.0.2

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

Phymnary.SugarPot.DependencyInjection

Lightweight primitives for convention-based dependency registration.

This project provides simple contracts and attributes to standardize how services are discovered and added to the .NET IServiceCollection.

Features

  • IAutoRegister interface for explicit dependency registration
  • [Auto] marker attribute for discoverable classes
  • [Service(Lifetime)] attribute to declare service lifetime
  • Lifetime enum (Singleton, Scoped, Transient)
  • Optional self-registration with ServiceAttribute.IsSelf

Installation

Install-Package Phymnary.SugarPot.DependencyInjection

API Overview

IAutoRegister

Implement this interface when a module/class should register dependencies manually:

using Microsoft.Extensions.DependencyInjection;
using Phymnary.SugarPot.DependencyInjection;

public sealed class UserAutoRegister : IAutoRegister
{
    public void AddDependencies(IServiceCollection services)
    {
        services.AddScoped<IUserRepository, UserRepository>();
    }
}

[Auto]

Use this marker attribute to indicate a class is eligible for automatic discovery/registration by consumers:

using Phymnary.SugarPot.DependencyInjection;

[Auto]
public sealed class BackgroundJobRunner
{
}

[Service]

Use this attribute to declare the intended lifetime:

using Phymnary.SugarPot.DependencyInjection;

[Service(Lifetime.Scoped)]
public sealed class UserService : IUserService
{
}

Register as self (concrete type) when needed:

[Service(Lifetime.Singleton, IsSelf = true)]
public sealed class CacheWarmupService
{
}

Notes

  • This project intentionally stays minimal and framework-agnostic.
  • Actual assembly scanning/registration behavior is implemented by consuming projects.

Target Frameworks

  • .NET Standard 2.1
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 is compatible.  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 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 (1)

Showing the top 1 NuGet packages that depend on Phymnary.SugarPot.DependencyInjection:

Package Downloads
Phymnary.SugarPot.Module

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 499 6/15/2026
1.0.1 117 6/10/2026
1.0.0 598 6/5/2026