We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
提供自动注入的支持 .NET7+
public interface ITestService { string Say(string message); } public interface ITest2Service { string Say2(string message); } [AutoInject] [AutoInject<TestService>] [AutoInject<ITestService>(ServiceLifetime.Singleton)] [AutoInject<ITest2Service>(ServiceLifetime.Scoped)] public class TestService : ITestService, ITest2Service { public string Say(string message) { return $"hello {message}"; } public string Say2(string message) { return message; } }
The text was updated successfully, but these errors were encountered:
#7 Support Auto Inject
ac1093a
6b06434
63a3452
Support keyed Auto Inject #7
9c3b200
提供 NET8 keyed Service的支持
//NET8.0+ 支持keyed [AutoInjectKeyed<ITest2Service>("test2", ServiceLifetime.Transient)] [AutoInjectKeyed<ITest2Service>(nameof(TestService2))] public class TestService2 : ITest2Service { public string Say2(string message) { return message; } }
将会创建类似的代码:
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAutoInject(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) { services.AddKeyedTransient<Biwen.AutoClassGen.TestConsole.Services.ITest2Service, Biwen.AutoClassGen.TestConsole.Services.TestService2>("test2"); services.AddKeyedScoped<Biwen.AutoClassGen.TestConsole.Services.ITest2Service, Biwen.AutoClassGen.TestConsole.Services.TestService2>("TestService2"); return services; }
Sorry, something went wrong.
No branches or pull requests
提供自动注入的支持 .NET7+
The text was updated successfully, but these errors were encountered: