Skip to content

Commit

Permalink
update references and frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
aloneguid committed Sep 15, 2021
1 parent 784b293 commit 15d0b6c
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ pr:
variables:
- group: 'External Resources'
- name: v
value: '4.15.0'
value: '4.16.0'
- name: av
value: '4.0.0'
- name: pv
value: '4.15.0'
value: '4.16.0'

steps:

Expand Down
2 changes: 1 addition & 1 deletion src/Config.Net.Json/Config.Net.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.7.3.0</FileVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Config.Net.Tests/Config.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Update="TestData\sample.Debug.json">
Expand Down
2 changes: 1 addition & 1 deletion src/Config.Net.Yaml/Config.Net.Yaml.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<AssemblyOriginatorKeyFile>../config.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.7.3.0</FileVersion>
Expand Down
16 changes: 12 additions & 4 deletions src/Config.Net/Config.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Copyright>Copyright (c) 2015-2018 by Ivan Gavryliuk</Copyright>
<AssemblyTitle>Config.Net</AssemblyTitle>
<Authors>Ivan Gavryliuk (@aloneguid)</Authors>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<AssemblyName>Config.Net</AssemblyName>
<PackageId>Config.Net</PackageId>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
Expand All @@ -16,10 +16,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.4.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Text.Json" Version="4.7.0" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions src/Config.Net/Core/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;

namespace Config.Net.Core
{
static class Extensions
{
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
public static TValue GetValueOrDefaultInternal<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
{
if (!dictionary.TryGetValue(key, out TValue value)) return default(TValue);

Expand Down
6 changes: 3 additions & 3 deletions src/Config.Net/Stores/DictionaryConfigStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ public string Read(string key)
{
if (key == null) return null;

if (FlatArrays.IsArrayLength(key, k => _container.GetValueOrDefault(k), out int length))
if (FlatArrays.IsArrayLength(key, k => _container.GetValueOrDefaultInternal(k), out int length))
{
return length.ToString();
}

if (FlatArrays.IsArrayElement(key, k => _container.GetValueOrDefault(k), out string element))
if (FlatArrays.IsArrayElement(key, k => _container.GetValueOrDefaultInternal(k), out string element))
{
return element;
}

return _container.GetValueOrDefault(key);
return _container.GetValueOrDefaultInternal(key);
}

public void Write(string key, string value)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#if !NETSTANDARD14
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Config.Net.Core;
using Config.Net.TypeParsers;

Expand Down Expand Up @@ -36,12 +34,12 @@ public string Read(string key)
{
if (key == null) return null;

if(FlatArrays.IsArrayLength(key, k => _nameToValue.GetValueOrDefault(k), out int length))
if(FlatArrays.IsArrayLength(key, k => _nameToValue.GetValueOrDefaultInternal(k), out int length))
{
return length.ToString();
}

if(FlatArrays.IsArrayElement(key, k => _nameToValue.GetValueOrDefault(k), out string element))
if(FlatArrays.IsArrayElement(key, k => _nameToValue.GetValueOrDefaultInternal(k), out string element))
{
return element;
}
Expand Down

0 comments on commit 15d0b6c

Please sign in to comment.