Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhozaifaa/meteors.dependencyinjection.autoservice
Auto inject services, Microsoft.Extensions.DependencyInjection, easy to add your services without need to touch startup, powerful, useful with multi dll's shearing same startup
https://github.com/mhozaifaa/meteors.dependencyinjection.autoservice
automatic cs dependency-injection extensions lifetime microsoft services
Last synced: 19 days ago
JSON representation
Auto inject services, Microsoft.Extensions.DependencyInjection, easy to add your services without need to touch startup, powerful, useful with multi dll's shearing same startup
- Host: GitHub
- URL: https://github.com/mhozaifaa/meteors.dependencyinjection.autoservice
- Owner: MhozaifaA
- License: mit
- Created: 2022-05-28T19:33:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-30T12:19:51.000Z (12 months ago)
- Last Synced: 2024-04-26T09:45:15.150Z (8 months ago)
- Topics: automatic, cs, dependency-injection, extensions, lifetime, microsoft, services
- Language: C#
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [Meteors] DependencyInjection.AutoService
[](https://www.nuget.org/packages/Meteors.DependencyInjection.AutoService/)[![](https://img.shields.io/nuget/v/Meteors.DependencyInjection.AutoService)](https://www.nuget.org/packages/Meteors.DependencyInjection.AutoService)
### ``Install-Package Meteors.DependencyInjection.AutoService -Version 8.0.0``
[Source Code](https://github.com/MhozaifaA/DependencyInjection.AutoService)
``` C#
//build.Services.AddAutoService(Assembly..namesapces..type);
build.Services.AddAutoService();
...
[AutoService(ServiceLifeTime, InterfaceType)]
[AutoService(ServiceLifeTime, InterfaceType)]
[AutoService()]
[AutoService(LifetimeType)]
[AutoService(ImplementationType)]
[AutoService(UseImplementation)]
[AutoService(LifetimeType,ImplementationType)]
[AutoService(LifetimeType,UseImplementation)]
[AutoService(ImplementationType,UseImplementation)]
[AutoService(LifetimeType,ImplementationType,UseImplementation,ServiceKey)][AutoService] //default Scoped
class AnyService : IAnyService { }[AutoService(typeOf(ICustomInterfaceName))] //take Implementation
class AnyService : ICustomInterfaceName { }[AutoService(typeOf(ICustomInterfaceName1))] //take Implementation 1
class AnyService : ICustomInterfaceName,ICustomInterfaceName1,ICustomInterfaceName2 { }[AutoService] //take Implementation IAnyService, is not first but same I + service-name
class AnyService : ICustomInterfaceName,IAnyService,ICustomInterfaceName2 { }[AutoService] //take class
class AnyService {}[AutoService]//as UseImplementation=true or null and take first interface
class AnyService : ICustomInterfaceName { }[AutoService(false)] //UseImplementation=false
class AnyService : ICustomInterfaceName { }[AutoService("servicekeyed")] //take class, and get by servicekeyed
class AnyService {}```
> This lib belongs to the **Meteors**,
> Meteorites helps you write less and clean code with the power of design patterns and full support for the most popular programming for perpetual projects
>
> All you need in your project is to use meteorites,
> Simplicity is one in all,