Skip to content

Commit 93bea24

Browse files
committed
Code review by @raman-m
1 parent 6ee8871 commit 93bea24

File tree

3 files changed

+71
-67
lines changed

3 files changed

+71
-67
lines changed

src/Ocelot/Configuration/Repository/FileConfigurationPoller.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private async Task Poll()
6969

7070
if (fileConfig.IsError)
7171
{
72-
_logger.LogWarning(() => $"error geting file config, errors are {string.Join(',', fileConfig.Errors.Select(x => x.Message))}");
72+
_logger.LogWarning(() =>$"error geting file config, errors are {string.Join(',', fileConfig.Errors.Select(x => x.Message))}");
7373
return;
7474
}
7575

src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
using Microsoft.Extensions.Configuration.Memory;
44
using Ocelot.Configuration.File;
55
using Ocelot.Infrastructure;
6+
using System.Text;
67
using System.Text.Json;
7-
8+
89
namespace Ocelot.DependencyInjection
910
{
1011
/// <summary>
@@ -99,8 +100,8 @@ public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder
99100
private static IConfigurationBuilder ApplyMergeOcelotJsonOption(IConfigurationBuilder builder, MergeOcelotJson mergeTo, string json,
100101
string primaryConfigFile, bool? optional, bool? reloadOnChange)
101102
{
102-
return mergeTo == MergeOcelotJson.ToMemory ?
103-
builder.AddJsonStream(new MemoryStream(Encoding.UTF8.GetBytes(json))) :
103+
return mergeTo == MergeOcelotJson.ToMemory ?
104+
builder.AddJsonStream(new MemoryStream(Encoding.UTF8.GetBytes(json))) :
104105
AddOcelotJsonFile(builder, json, primaryConfigFile, optional, reloadOnChange);
105106
}
106107

src/Ocelot/Ocelot.csproj

+66-63
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,68 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
4-
<ImplicitUsings>disable</ImplicitUsings>
5-
<Nullable>disable</Nullable>
6-
<NoPackageAnalysis>true</NoPackageAnalysis>
7-
<Description>Ocelot is an API gateway based on .NET stack.</Description>
8-
<AssemblyTitle>Ocelot</AssemblyTitle>
9-
<VersionPrefix>0.0.0-dev</VersionPrefix>
10-
<AssemblyName>Ocelot</AssemblyName>
11-
<PackageId>Ocelot</PackageId>
12-
<PackageTags>API Gateway;.NET core</PackageTags>
13-
<PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
14-
<PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
15-
<PackageReadmeFile>README.md</PackageReadmeFile>
16-
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
17-
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
18-
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
19-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
20-
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
21-
<Authors>Tom Pallister</Authors>
22-
<CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
23-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
24-
<NoWarn>1591</NoWarn>
25-
</PropertyGroup>
26-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
27-
<DebugType>full</DebugType>
28-
<DebugSymbols>True</DebugSymbols>
29-
</PropertyGroup>
30-
<!-- Project dependencies -->
31-
<ItemGroup>
32-
<PackageReference Include="FluentValidation" Version="11.8.0" />
33-
<PackageReference Include="IPAddressRange" Version="6.0.0" />
34-
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32">
35-
<NoWarn>NU1701</NoWarn>
36-
</PackageReference>
37-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
38-
<PrivateAssets>all</PrivateAssets>
39-
</PackageReference>
40-
</ItemGroup>
41-
<ItemGroup>
42-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
43-
</ItemGroup>
44-
<!-- Conditionally obtain references for the net 6.0 target -->
45-
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
46-
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="6.0.25" />
47-
<PackageReference Include="System.Text.Json" Version="6.0.9" />
48-
<PackageReference Include="JsonPath.Net" Version="0.7.1" />
49-
</ItemGroup>
50-
<!-- Conditionally obtain references for the net 7.0 target -->
51-
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
52-
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="7.0.14" />
53-
<PackageReference Include="System.Text.Json" Version="7.0.4" />
54-
<PackageReference Include="JsonPath.Net" Version="0.7.1" />
55-
</ItemGroup>
56-
<!-- Conditionally obtain references for the net 8.0 target -->
57-
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
58-
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.0" />
59-
<PackageReference Include="System.Text.Json" Version="8.0.0" />
60-
<PackageReference Include="JsonPath.Net" Version="1.1.2" />
61-
</ItemGroup>
62-
<ItemGroup>
63-
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
64-
</ItemGroup>
2+
<PropertyGroup>
3+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
4+
<ImplicitUsings>disable</ImplicitUsings>
5+
<Nullable>disable</Nullable>
6+
<NoPackageAnalysis>true</NoPackageAnalysis>
7+
<Description>Ocelot is an API gateway based on .NET stack.</Description>
8+
<AssemblyTitle>Ocelot</AssemblyTitle>
9+
<VersionPrefix>0.0.0-dev</VersionPrefix>
10+
<AssemblyName>Ocelot</AssemblyName>
11+
<PackageId>Ocelot</PackageId>
12+
<PackageTags>API Gateway;.NET core</PackageTags>
13+
<PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
14+
<PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
17+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
18+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
19+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
20+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
21+
<Authors>Tom Pallister</Authors>
22+
<CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
23+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
24+
<NoWarn>1591</NoWarn>
25+
</PropertyGroup>
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
27+
<DebugType>full</DebugType>
28+
<DebugSymbols>True</DebugSymbols>
29+
</PropertyGroup>
30+
<!-- Project dependencies -->
31+
<ItemGroup>
32+
<PackageReference Include="FluentValidation" Version="11.8.0" />
33+
<PackageReference Include="IPAddressRange" Version="6.0.0" />
34+
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32">
35+
<NoWarn>NU1701</NoWarn>
36+
</PackageReference>
37+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
38+
<PrivateAssets>all</PrivateAssets>
39+
</PackageReference>
40+
</ItemGroup>
41+
<ItemGroup>
42+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
43+
</ItemGroup>
44+
<!-- Conditionally obtain references for the net 6.0 target -->
45+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
46+
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="6.0.25" />
47+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.25" />
48+
<PackageReference Include="System.Text.Json" Version="6.0.9" />
49+
<PackageReference Include="JsonPath.Net" Version="0.7.1" />
50+
</ItemGroup>
51+
<!-- Conditionally obtain references for the net 7.0 target -->
52+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
53+
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="7.0.14" />
54+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.14" />
55+
<PackageReference Include="System.Text.Json" Version="7.0.4" />
56+
<PackageReference Include="JsonPath.Net" Version="0.7.1" />
57+
</ItemGroup>
58+
<!-- Conditionally obtain references for the net 8.0 target -->
59+
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
60+
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.0" />
61+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
62+
<PackageReference Include="System.Text.Json" Version="8.0.0" />
63+
<PackageReference Include="JsonPath.Net" Version="1.1.2" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
67+
</ItemGroup>
6568
</Project>

0 commit comments

Comments
 (0)