Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"Xunit"
"autofac",
"xunit"
],
"omnisharp.enableEditorConfigSupport": true
}
2 changes: 1 addition & 1 deletion default.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
<PropertyGroup>
<!-- Increment the overall semantic version here. -->
<Version>6.1.2</Version>
<Version>7.0.0</Version>
<SolutionName>Autofac.Extras.AggregateService</SolutionName>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<ArtifactDirectory>$([System.IO.Path]::Combine($(MSBuildProjectDirectory),"artifacts"))</ArtifactDirectory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Dynamic aggregate service implementation generation for Autofac.</Description>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -40,19 +40,12 @@
<AdditionalFiles Include="../../build/stylecop.json" Link="stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="6.0.0" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" Condition="Exists('$(MSBuildThisFileDirectory)../../.git')">
<PackageReference Include="Autofac" Version="9.1.0" />
<PackageReference Include="Castle.Core" Version="5.2.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.300" Condition="Exists('$(MSBuildThisFileDirectory)../../.git')">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void Intercept(IInvocation invocation)
}

return method
.DeclaringType
.DeclaringType?
.GetProperties()
.Where(prop => prop.GetGetMethod() == method)
.FirstOrDefault();
Expand Down Expand Up @@ -159,7 +159,8 @@ private Dictionary<MethodInfo, Action<IInvocation>> SetupInvocationMap(Type inte
}

// Methods without parameters
var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic);
var methodWithoutParams = GetType().GetMethod(nameof(MethodWithoutParams), BindingFlags.Instance | BindingFlags.NonPublic)
?? throw new InvalidOperationException($"Unable to locate the {nameof(MethodWithoutParams)} method via reflection.");
var methodWithoutParamsDelegate = (Action<IInvocation>)methodWithoutParams.CreateDelegate(typeof(Action<IInvocation>), this);
methodMap.Add(method, methodWithoutParamsDelegate);
}
Expand Down
Loading