-
Register for class
interface ITestService { } [ServiceImplementation(ServiceLifetime.Scoped, typeof(ITestService))] class TestService : ITestService { } [ServiceImplementation(ServiceLifetime.Scoped)] class TestServiceTwo { } it only register one.
-
Register for interface
[ServiceInterfaceAttribute(ServiceLifetime.Scoped)] interface ITestService { } class TestServiceOne : ITestService { } class TestServiceTwo : ITestService { }
it will register the implementation classes of all inherited interfaces.
-
how to use in serviceCollection
services.AddAutoRegister(typeof(Startup).GetTypeInfo().Assembly);
-
Notifications
You must be signed in to change notification settings - Fork 0
License
mingxiaoyu/AutoRegister.Extensions.Microsoft.DependencyInjection
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published