File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed
src/AspectCore.Extensions.Autofac
tests/AspectCore.Extensions.Autofac.Test Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 2121
2222
2323 <ItemGroup >
24- <PackageReference Include =" Autofac" Version =" [7 .0.0, 8 .0.0)" />
24+ <PackageReference Include =" Autofac" Version =" [8 .0.0, 9 .0.0)" />
2525 </ItemGroup >
2626
2727 <ItemGroup >
Original file line number Diff line number Diff line change 22using AspectCore . DynamicProxy ;
33using AspectCore . DependencyInjection ;
44using Autofac ;
5+ using Autofac . Core ;
6+ using Autofac . Core . Lifetime ;
57
68namespace AspectCore . Extensions . Autofac
79{
@@ -34,12 +36,20 @@ public object Resolve(Type serviceType)
3436#if NET8_0_OR_GREATER
3537 public object GetKeyedService ( Type serviceType , object serviceKey )
3638 {
37- throw new NotImplementedException ( ) ;
39+ if ( serviceKey is null )
40+ {
41+ return _componentContext . ResolveOptional ( serviceType ) ;
42+ }
43+ return _componentContext . ResolveKeyed ( serviceKey , serviceType ) ;
3844 }
3945
4046 public object GetRequiredKeyedService ( Type serviceType , object serviceKey )
4147 {
42- throw new NotImplementedException ( ) ;
48+ if ( serviceKey is null )
49+ {
50+ return _componentContext . Resolve ( serviceType ) ;
51+ }
52+ return _componentContext . ResolveKeyed ( serviceKey , serviceType ) ;
4353 }
4454#endif
4555 }
Original file line number Diff line number Diff line change 1818 </ItemGroup >
1919
2020 <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0' " >
21- <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 8 .0.0" />
22- <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Specification.Tests" Version =" 6 .0.0" />
21+ <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 9 .0.0" />
22+ <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Specification.Tests" Version =" 8 .0.0" />
2323 </ItemGroup >
2424
2525 <ItemGroup Condition =" '$(TargetFramework)' == 'net7.0' " >
26- <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 8 .0.0" />
27- <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Specification.Tests" Version =" 7 .0.0" />
26+ <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 9 .0.0" />
27+ <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Specification.Tests" Version =" 8 .0.0" />
2828 </ItemGroup >
2929
3030 <ItemGroup Condition =" '$(TargetFramework)' == 'net8.0' " >
31- <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 8 .0.0" />
31+ <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 9 .0.0" />
3232 <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Specification.Tests" Version =" 8.0.0" />
3333 </ItemGroup >
3434
You can’t perform that action at this time.
0 commit comments