https://github.com/usausa/service-registration-generator
https://github.com/usausa/service-registration-generator
Last synced: 10 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T10:21:57.000Z (over 1 year ago)
- Last Synced: 2025-01-06T10:22:23.445Z (over 1 year 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
README
# BunnyTail.ServiceRegistrationGenerator
| Package | Info |
|:-|:-|
| BunnyTail.ServiceRegistration | [](https://www.nuget.org/packages/BunnyTail.ServiceRegistration) |
## What is this?
Service registory method generator.
## Usage
```csharp
using BunnyTail.ServiceRegistration;
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
{
}
```