Skip to content

Commit 1239fda

Browse files
committed
recognize IConfigurationSection parameter types
1 parent 80b2ec9 commit 1239fda

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Serilog.Settings.Configuration/Serilog.Settings.Configuration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<PackageProjectUrl>https://github.com/serilog/serilog-settings-configuration</PackageProjectUrl>
1818
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
1919
<RootNamespace>Serilog</RootNamespace>
20-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
21-
<Version>3.0.0</Version>
20+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
21+
<Version>3.0.0.7</Version>
2222
<AssemblyVersion>3.0.0.0</AssemblyVersion>
2323
<FileVersion>3.0.0</FileVersion>
2424
</PropertyGroup>

src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ IConfigurationArgumentValue GetArgumentValue(IConfigurationSection argumentSecti
244244
}
245245
else
246246
{
247-
argumentValue = new BoundArgumentValue(argumentSection);
247+
argumentValue = new ObjectArgumentValue(argumentSection);
248248
}
249249
}
250250

src/Serilog.Settings.Configuration/Settings/Configuration/BoundArgumentValue.cs renamed to src/Serilog.Settings.Configuration/Settings/Configuration/ObjectArgumentValue.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55

66
namespace Serilog.Settings.Configuration
77
{
8-
class BoundArgumentValue : IConfigurationArgumentValue
8+
class ObjectArgumentValue : IConfigurationArgumentValue
99
{
1010
readonly IConfigurationSection section;
1111

12-
public BoundArgumentValue(IConfigurationSection section)
12+
public ObjectArgumentValue(IConfigurationSection section)
1313
{
1414
this.section = section;
1515
}
1616

1717
public object ConvertTo(Type toType, IReadOnlyDictionary<string, LoggingLevelSwitch> declaredLevelSwitches)
1818
{
19+
if(toType == typeof(IConfigurationSection)) return section;
1920
return section.Get(toType);
2021
}
2122
}

0 commit comments

Comments
 (0)