-
Add
Injectable
attribute to your serviceusing InjectableServices; // The attribute [Injectable(ServiceLifetime.Scoped)] public class ItemService : IItemService { private DataContext Context { get; } public ItemService(DataContext dataContext) { Context = dataContext; } public Item[] GetAllItems() { return Context.Items.ToArray(); } }
-
Easily register injectable services
using InjectableServices; var builder = WebApplication.CreateBuilder(args); // The services registration builder.Services.AddInjectableServices(); var app = builder.Build();
-
Notifications
You must be signed in to change notification settings - Fork 0
NuGet package for creating injectable services for DependencyInjection
License
maxchistt/InjectableServices
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
NuGet package for creating injectable services for DependencyInjection