https://github.com/usausa/service-registration-generator
https://github.com/usausa/service-registration-generator
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/usausa/service-registration-generator
- Owner: usausa
- License: mit
- Created: 2025-01-06T03:43:09.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-06T10:21:57.000Z (3 months ago)
- Last Synced: 2025-01-06T10:22:23.445Z (3 months ago)
- Language: C#
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - https://github.com/usausa/service-registration-generator - registration-generator (Contributors Welcome for those / 1. [ThisAssembly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ThisAssembly) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category)
README
# Service registory method generator
| Package | Info |
|:-|:-|
| BunnyTail.ServiceRegistrationGenerator | [](https://www.nuget.org/packages/BunnyTail.ServiceRegistrationGenerator) |## Usage
```csharp
namespace ServiceRegistrationGenerator.Example;using ServiceRegistrationGenerator;
using Microsoft.Extensions.DependencyInjection;
internal static class Program
{
public static void Main()
{
using var provider = new ServiceCollection()
.AddServices()
.BuildServiceProvider();var service = provider.GetRequiredService();
}
}internal static partial class ServiceCollectionExtensions
{
[ServiceRegistration(Lifetime.Singleton, "Service$")]
public static partial IServiceCollection AddServices(this IServiceCollection services);
}internal sealed class TestService
{
}
```