Shiny.Extensions.DependencyInjection 1.0.0-g5fce6b880d
Shiny Extensions
Dependency Injection Extensions
- Source generate all attributed classes to a single add file - saves you the boilerplate
- Extension methods for registering a dependency against multiple interfaces
- Extension methods for startup tasks (different to hosted services that don't work on mobile)
- Supports multiple interfaces
- Supports open generics
- Supports keyed services
THIS:
using Microsoft.Extensions.DependencyInjection;
using Shiny.Extensions.DependencyInjection;
// given the following code from a user
namespace Sample
{
public interface IStandardInterface;
public interface IStandardInterface2;
[Service(ServiceLifetime.Singleton)]
public class ImplementationOnly;
[Service(ServiceLifetime.Transient, "ImplOnly")]
public class KeyedImplementationOnly;
[Service(ServiceLifetime.Singleton)]
public class StandardImplementation : IStandardInterface;
[Service(ServiceLifetime.Scoped, "Standard")]
public class KeyedStandardImplementation : IStandardInterface;
[Service(ServiceLifetime.Singleton)]
public class MultipleImplementation : IStandardInterface, IStandardInterface2;
[Service(ServiceLifetime.Scoped)]
public class ScopedMultipleImplementation : IStandardInterface, IStandardInterface2;
[Service(ServiceLifetime.Scoped, "KeyedGeneric")]
public class TestGeneric<T1, T2>
{
public T1 Value1 { get; set; }
public T2 Value2 { get; set; }
}
}
GENERATES THIS:
// <auto-generated />
using global::Microsoft.Extensions.DependencyInjection;
using global::Shiny.Extensions.DependencyInjection;
namespace Sample
{
public static class __GeneratedRegistrations
{
public static global::Microsoft.Extensions.DependencyInjection.IServiceCollection AddGeneratedServices(
this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services
)
{
services.AddSingleton<global::Sample.ImplementationOnly>();
services.AddKeyedTransient<global::Sample.KeyedImplementationOnly>("ImplOnly");
services.AddSingleton<global::Sample.IStandardInterface, global::Sample.StandardImplementation>();
services.AddKeyedScoped<global::Sample.IStandardInterface, global::Sample.KeyedStandardImplementation>("Standard");
services.AddSingletonAsImplementedInterfaces<global::Sample.MultipleImplementation>();
services.AddScopedAsImplementedInterfaces<global::Sample.ScopedMultipleImplementation>();
services.AddKeyedScoped(typeof(global::Sample.TestGeneric<,>), "KeyedGeneric");
return services;
}
}
}
Stores
- Key/value store with support for
- Android/iOS/Windows - Preferences & Secure Storage
- Web - Local Storage & Session Storage
- In Memory
- Object binder binds INotifyPropertyChanged against a key/value store to persist object changes across sessions
- Simply implement IKeyValueStore to create your own store
Web Hosting Extensions
- Merges service container build and post build scenarios into a single class
- All IInfrastructureModule implementations are automatically detected and run
Additional Libraries Used
- Shiny Reflector - Reflection without the actual reflection
Showing the top 20 packages that depend on Shiny.Extensions.DependencyInjection.
| Packages | Downloads |
|---|---|
|
Shiny.Hosting.Maui
Shiny
|
1 |
|
Shiny.Extensions.Stores
Store anything in a key/value store - Abstractions for iOS, Android and Windows preferences/secure storage
|
1 |
|
Shiny.Jobs
Shiny Background Jobs
|
1 |
|
Shiny.Core
The Shiny Core Foundation where all Shiny modules are built on
|
1 |
.NET 9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 5.1.1 | 1 | 06/22/2026 |
| 5.1.0 | 1 | 06/22/2026 |
| 5.1.0-beta-0054 | 1 | 06/22/2026 |
| 5.1.0-beta-0052 | 1 | 06/13/2026 |
| 5.1.0-beta-0051 | 1 | 06/13/2026 |
| 5.0.0 | 1 | 06/13/2026 |
| 5.0.0-beta-0052 | 1 | 06/13/2026 |
| 5.0.0-beta-0051 | 1 | 06/13/2026 |
| 4.1.1 | 1 | 06/13/2026 |
| 4.1.0 | 1 | 06/13/2026 |
| 4.0.0 | 1 | 06/13/2026 |
| 4.0.0-beta-0063 | 1 | 06/13/2026 |
| 4.0.0-beta-0062 | 1 | 06/13/2026 |
| 4.0.0-beta-0061 | 1 | 06/13/2026 |
| 4.0.0-beta-0060 | 1 | 06/13/2026 |
| 4.0.0-beta-0059 | 1 | 06/13/2026 |
| 4.0.0-beta-0058 | 1 | 06/13/2026 |
| 4.0.0-beta-0057 | 1 | 06/13/2026 |
| 4.0.0-beta-0056 | 1 | 06/13/2026 |
| 4.0.0-beta-0041 | 1 | 06/13/2026 |
| 4.0.0-beta-0005 | 1 | 06/13/2026 |
| 4.0.0-beta-0004 | 1 | 06/13/2026 |
| 4.0.0-beta-0003 | 1 | 06/13/2026 |
| 4.0.0-beta-0002 | 1 | 06/13/2026 |
| 3.0.0 | 1 | 06/13/2026 |
| 2.1.0-beta-0045 | 1 | 06/13/2026 |
| 2.1.0-beta-0044 | 1 | 06/13/2026 |
| 2.1.0-beta-0043 | 1 | 06/13/2026 |
| 2.1.0-beta-0042 | 1 | 06/13/2026 |
| 2.1.0-beta-0041 | 1 | 06/13/2026 |
| 2.0.4 | 1 | 06/13/2026 |
| 2.0.3 | 1 | 06/13/2026 |
| 2.0.2 | 1 | 06/13/2026 |
| 2.0.1 | 1 | 06/13/2026 |
| 2.0.0 | 1 | 06/13/2026 |
| 2.0.0-beta-0047 | 1 | 06/13/2026 |
| 2.0.0-beta-0006 | 1 | 06/13/2026 |
| 2.0.0-beta-0005 | 1 | 06/13/2026 |
| 2.0.0-beta-0001 | 1 | 06/13/2026 |
| 1.3.1 | 1 | 06/13/2026 |
| 1.3.1-beta-0001 | 1 | 06/13/2026 |
| 1.3.0 | 1 | 06/13/2026 |
| 1.3.0-beta-0009 | 1 | 06/13/2026 |
| 1.3.0-beta-0008 | 1 | 06/13/2026 |
| 1.3.0-beta-0007 | 1 | 06/13/2026 |
| 1.3.0-beta-0006 | 1 | 06/13/2026 |
| 1.3.0-beta-0004 | 1 | 06/13/2026 |
| 1.3.0-beta-0003 | 1 | 06/13/2026 |
| 1.3.0-beta-0002 | 1 | 06/13/2026 |
| 1.3.0-beta-0001 | 1 | 06/13/2026 |
| 1.2.2 | 1 | 06/13/2026 |
| 1.2.1 | 1 | 06/13/2026 |
| 1.2.0 | 1 | 06/12/2026 |
| 1.2.0-beta-0001 | 1 | 06/13/2026 |
| 1.1.0 | 1 | 06/13/2026 |
| 1.1.0-beta-0009 | 1 | 06/13/2026 |
| 1.1.0-beta-0008 | 1 | 06/13/2026 |
| 1.1.0-beta-0007 | 1 | 06/13/2026 |
| 1.1.0-beta-0006 | 1 | 06/13/2026 |
| 1.1.0-beta-0004 | 1 | 06/13/2026 |
| 1.1.0-beta-0003 | 1 | 06/13/2026 |
| 1.1.0-beta-0002 | 1 | 06/13/2026 |
| 1.0.3 | 1 | 06/13/2026 |
| 1.0.2 | 1 | 06/13/2026 |
| 1.0.1 | 1 | 06/13/2026 |
| 1.0.0 | 1 | 06/13/2026 |
| 1.0.0-g5fce6b880d | 1 | 06/13/2026 |
| 1.0.0-alpha-0020 | 1 | 06/13/2026 |
| 1.0.0-alpha-0019 | 1 | 06/13/2026 |
| 1.0.0-alpha-0018 | 1 | 06/13/2026 |
| 1.0.0-alpha-0017 | 1 | 06/13/2026 |
| 1.0.0-alpha-0016 | 1 | 06/13/2026 |
| 1.0.0-alpha-0015 | 1 | 06/13/2026 |
| 1.0.0-alpha-0014 | 1 | 06/13/2026 |
| 1.0.0-alpha-0013 | 1 | 06/13/2026 |
| 1.0.0-alpha-0011 | 1 | 06/13/2026 |
| 1.0.0-alpha-0010 | 1 | 06/13/2026 |
| 1.0.0-alpha-0009 | 1 | 06/13/2026 |