Skip to content

Commit 5118125

Browse files
author
Gui Ferreira
authored
refactor: adopt same code conventions as kafkaflow (#145)
* refactor: file scoped namespaces * refactor:global usings * refactor: use _ as private field prefix * refactor: move test projects to tests folder * refactor: move sln to root * refactor: cleanup testing warnings * refactor: cleanup and reformat code * refactor: update gh actions workflows * refactor: apply codacy suggestions
1 parent 9ee2ed2 commit 5118125

File tree

577 files changed

+20074
-20132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+20074
-20132
lines changed

.editorconfig

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# editorconfig.org
2+
3+
[*.cs]
4+
# Naming rules for fields
5+
dotnet_naming_rule.private_fields_with_underscore.symbols = private_field
6+
dotnet_naming_rule.private_fields_with_underscore.style = prefix_underscore
7+
dotnet_naming_rule.private_fields_with_underscore.severity = warning
8+
9+
dotnet_naming_symbols.private_field.applicable_kinds = field
10+
dotnet_naming_symbols.private_field.applicable_accessibilities = private
11+
dotnet_naming_symbols.private_field.required_modifiers =
12+
13+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
14+
dotnet_naming_style.prefix_underscore.required_prefix = _
15+
16+
# Naming rules for properties
17+
dotnet_naming_rule.private_properties_with_underscore.symbols = private_property
18+
dotnet_naming_rule.private_properties_with_underscore.style = prefix_underscore
19+
dotnet_naming_rule.private_properties_with_underscore.severity = warning
20+
21+
dotnet_naming_symbols.private_property.applicable_kinds = property
22+
dotnet_naming_symbols.private_property.applicable_accessibilities = private
23+
dotnet_naming_symbols.private_property.required_modifiers =
24+
25+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
26+
dotnet_naming_style.prefix_underscore.required_prefix = _
27+
28+
# Do not use 'this.' for private fields
29+
dotnet_diagnostic.DOTNET_Naming_Style_DoNotUseThisForPrivateFields.severity = warning
30+
dotnet_diagnostic.DOTNET_Naming_Style_DoNotUseThisForPrivateFields.symbols = field_like
31+
32+
dotnet_diagnostic.CA2007.severity = none
33+
dotnet_diagnostic.CS1591.severity = none
34+
35+
dotnet_naming_rule.style_dotnet_naming_rule_DotNetNamingStyle.DoNotUseThisForPrivateFields.symbols = field_like
36+
dotnet_naming_rule.style_dotnet_naming_rule_DotNetNamingStyle.DoNotUseThisForPrivateFields.style = this_prefix
37+
dotnet_naming_rule.style_dotnet_naming_rule_DotNetNamingStyle.DoNotUseThisForPrivateFields.severity = warning
38+
39+
# name all constant fields using PascalCase
40+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
41+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
42+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
43+
44+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
45+
dotnet_naming_symbols.constant_fields.required_modifiers = const
46+
47+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
48+
49+
# static fields should have s_ prefix
50+
dotnet_naming_rule.static_fields_should_have_prefix.severity = warning
51+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
52+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
53+
54+
dotnet_naming_symbols.static_fields.applicable_kinds = field
55+
dotnet_naming_symbols.static_fields.required_modifiers = static
56+
57+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
58+
dotnet_naming_style.static_prefix_style.required_prefix = s_
59+
60+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
61+
62+
csharp_indent_labels = one_less_than_current
63+
csharp_using_directive_placement = outside_namespace:silent
64+
csharp_prefer_simple_using_statement = true:suggestion
65+
csharp_prefer_braces = true:silent
66+
csharp_style_namespace_declarations = block_scoped:silent
67+
csharp_style_namespace_declarations = file_scoped:error
68+
csharp_style_prefer_method_group_conversion = true:silent
69+
csharp_style_prefer_top_level_statements = true:silent
70+
csharp_style_prefer_primary_constructors = true:suggestion
71+
csharp_style_expression_bodied_methods = false:silent
72+
csharp_style_expression_bodied_constructors = false:silent
73+
csharp_style_expression_bodied_operators = false:silent
74+
csharp_style_expression_bodied_properties = true:silent
75+
csharp_style_expression_bodied_indexers = true:silent
76+
csharp_style_expression_bodied_accessors = true:silent
77+
csharp_style_expression_bodied_lambdas = true:silent
78+
csharp_style_expression_bodied_local_functions = false:silent
79+
80+
[*.{cs,vb}]
81+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
82+
tab_width = 4
83+
indent_size = 4
84+
end_of_line = crlf
85+
dotnet_style_coalesce_expression = true:suggestion
86+
dotnet_style_null_propagation = true:suggestion
87+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
88+
dotnet_style_prefer_auto_properties = true:silent
89+
dotnet_style_object_initializer = true:suggestion
90+
dotnet_style_prefer_collection_expression = true:suggestion
91+
dotnet_style_collection_initializer = true:suggestion
92+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
93+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
94+
dotnet_style_prefer_conditional_expression_over_return = true:silent
95+
dotnet_style_explicit_tuple_names = true:suggestion
96+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
97+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
98+
dotnet_style_prefer_compound_assignment = true:suggestion
99+
dotnet_style_prefer_simplified_interpolation = true:suggestion

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ jobs:
3939
echo "Branch name: $BRANCH_NAME"
4040
echo "Repository name: $REPOSITORY_NAME"
4141
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 0
4545
ref: ${{github.event.pull_request.head.ref}}
4646
repository: ${{github.event.pull_request.head.repo.full_name}}
4747

4848
- name: Setup .NET
49-
uses: actions/setup-dotnet@v1
49+
uses: actions/setup-dotnet@v3
5050
with:
5151
dotnet-version: 6.0.x
5252

5353
- name: Restore dependencies
54-
run: dotnet restore src/KafkaFlow.Retry.sln
54+
run: dotnet restore KafkaFlow.Retry.sln
5555

5656
- name: Build
57-
run: dotnet build --no-restore -c Release src/KafkaFlow.Retry.sln
57+
run: dotnet build --no-restore -c Release KafkaFlow.Retry.sln
5858

5959
- name: Start SqlServer
6060
run: docker run -d -p 1433:1433 -e ACCEPT_EULA=${{ env.ACCEPT_EULA }} -e SA_PASSWORD=${{ env.SQLSERVER_SA_PASSWORD }} -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2017-latest
@@ -78,4 +78,4 @@ jobs:
7878
auto create topic: "true" # Optional, auto create kafka topic
7979

8080
- name: Test
81-
run: dotnet test --no-build -c Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory:"../../coverage-outputs" -m:1 src/KafkaFlow.Retry.sln
81+
run: dotnet test --no-build -c Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory:"../../coverage-outputs" -m:1 KafkaFlow.Retry.sln

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
NUGET_SOURCE: https://api.nuget.org/v3/index.json
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717

1818
- name: Setup .NET
19-
uses: actions/setup-dotnet@v1
19+
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: 3.1.x
21+
dotnet-version: 6.0.x
2222

2323
- name: Update project version
2424
uses: roryprimrose/set-vs-sdk-project-version@v1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project>
22
<PropertyGroup>
3+
<LangVersion>10.0</LangVersion>
34
<PackageIconUrl>https://raw.githubusercontent.com/Farfetch/.github/master/images/fuse-logo-128.png</PackageIconUrl>
45
</PropertyGroup>
56
</Project>

src/KafkaFlow.Retry.sln renamed to KafkaFlow.Retry.sln

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,49 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Admin", "Admin", "{5AE4E956
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{1DF1AB0D-37CB-4AFC-B701-8F0F2B260E54}"
99
EndProject
10-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F92E5E32-4611-44A1-9EF6-0091F337877B}"
11-
EndProject
1210
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repositories", "Repositories", "{90B43DD5-C3CE-4BF8-B63E-3A34B962DC96}"
1311
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry", "KafkaFlow.Retry\KafkaFlow.Retry.csproj", "{9DC50EFE-C511-4DEC-A8EA-199795CEFE01}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry", "src\KafkaFlow.Retry\KafkaFlow.Retry.csproj", "{9DC50EFE-C511-4DEC-A8EA-199795CEFE01}"
1513
EndProject
16-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B1D2A20A-0742-4D8E-A773-66EB95560152}"
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B1D2A20A-0742-4D8E-A773-66EB95560152}"
1715
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.Sample", "..\samples\KafkaFlow.Retry.Sample\KafkaFlow.Retry.Sample.csproj", "{745CB854-1FFE-4C60-AD15-69A3A784CC9F}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.Sample", "samples\KafkaFlow.Retry.Sample\KafkaFlow.Retry.Sample.csproj", "{745CB854-1FFE-4C60-AD15-69A3A784CC9F}"
1917
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.SqlServer", "KafkaFlow.Retry.SqlServer\KafkaFlow.Retry.SqlServer.csproj", "{C61CCF7F-E7C8-4FEF-9E7E-22AB3ECD148D}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.SqlServer", "src\KafkaFlow.Retry.SqlServer\KafkaFlow.Retry.SqlServer.csproj", "{C61CCF7F-E7C8-4FEF-9E7E-22AB3ECD148D}"
2119
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.MongoDb", "KafkaFlow.Retry.MongoDb\KafkaFlow.Retry.MongoDb.csproj", "{F06DD63E-8965-4C43-BEEE-4ABBB5914FF8}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.MongoDb", "src\KafkaFlow.Retry.MongoDb\KafkaFlow.Retry.MongoDb.csproj", "{F06DD63E-8965-4C43-BEEE-4ABBB5914FF8}"
2321
EndProject
24-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.API", "KafkaFlow.Retry.API\KafkaFlow.Retry.API.csproj", "{D3664EBB-D77B-42C2-AF90-7B2F3E354C3F}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.API", "src\KafkaFlow.Retry.API\KafkaFlow.Retry.API.csproj", "{D3664EBB-D77B-42C2-AF90-7B2F3E354C3F}"
2523
EndProject
26-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.API.Sample", "..\samples\KafkaFlow.Retry.API.Sample\KafkaFlow.Retry.API.Sample.csproj", "{F27309CD-D796-425B-B5D6-780B7B57E9C7}"
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.API.Sample", "samples\KafkaFlow.Retry.API.Sample\KafkaFlow.Retry.API.Sample.csproj", "{F27309CD-D796-425B-B5D6-780B7B57E9C7}"
2725
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.UnitTests", "KafkaFlow.Retry.UnitTests\KafkaFlow.Retry.UnitTests.csproj", "{9E3B34BA-E309-4DA4-93D4-C0DD72D4711D}"
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.UnitTests", "tests\KafkaFlow.Retry.UnitTests\KafkaFlow.Retry.UnitTests.csproj", "{9E3B34BA-E309-4DA4-93D4-C0DD72D4711D}"
2927
EndProject
30-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.IntegrationTests", "KafkaFlow.Retry.IntegrationTests\KafkaFlow.Retry.IntegrationTests.csproj", "{A25A5E30-8D5A-40DB-BA21-7A5B4FB44DE0}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.IntegrationTests", "tests\KafkaFlow.Retry.IntegrationTests\KafkaFlow.Retry.IntegrationTests.csproj", "{A25A5E30-8D5A-40DB-BA21-7A5B4FB44DE0}"
3129
EndProject
3230
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9557F908-472F-4872-BCF8-8EC028EFDA9B}"
3331
ProjectSection(SolutionItems) = preProject
34-
CodeCoverage.runsettings = CodeCoverage.runsettings
3532
Directory.Build.props = Directory.Build.props
3633
EndProjectSection
3734
EndProject
38-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.SchemaRegistry.Sample", "..\samples\KafkaFlow.Retry.SchemaRegistry.Sample\KafkaFlow.Retry.SchemaRegistry.Sample.csproj", "{510D65E8-B62C-402C-9CE3-47C7055A29FF}"
35+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.SchemaRegistry.Sample", "samples\KafkaFlow.Retry.SchemaRegistry.Sample\KafkaFlow.Retry.SchemaRegistry.Sample.csproj", "{510D65E8-B62C-402C-9CE3-47C7055A29FF}"
3936
EndProject
40-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.Common.Sample", "..\samples\KafkaFlow.Retry.Common.Sample\KafkaFlow.Retry.Common.Sample.csproj", "{B14C5859-85C5-4E2F-80C7-D8B29E36481A}"
37+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Retry.Common.Sample", "samples\KafkaFlow.Retry.Common.Sample\KafkaFlow.Retry.Common.Sample.csproj", "{B14C5859-85C5-4E2F-80C7-D8B29E36481A}"
4138
EndProject
4239
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{2A0BC610-E0FE-4BC3-B232-A8B918BE7381}"
4340
ProjectSection(SolutionItems) = preProject
44-
..\.github\workflows\build.yml = ..\.github\workflows\build.yml
45-
..\.github\workflows\publish.yml = ..\.github\workflows\publish.yml
41+
.github\workflows\build.yml = .github\workflows\build.yml
42+
.github\workflows\publish.yml = .github\workflows\publish.yml
4643
EndProjectSection
4744
EndProject
48-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KafkaFlow.Retry.Postgres", "KafkaFlow.Retry.Postgres\KafkaFlow.Retry.Postgres.csproj", "{B7E4C23D-48DC-4056-8658-19D54AF7008A}"
45+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KafkaFlow.Retry.Postgres", "src\KafkaFlow.Retry.Postgres\KafkaFlow.Retry.Postgres.csproj", "{B7E4C23D-48DC-4056-8658-19D54AF7008A}"
46+
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0192C262-63AF-4918-B142-EC07DBB9E501}"
48+
EndProject
49+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{18F1AB11-9DC0-442F-9B6D-7098A93727B8}"
50+
ProjectSection(SolutionItems) = preProject
51+
CodeCoverage.runsettings = tests\CodeCoverage.runsettings
52+
EndProjectSection
4953
EndProject
5054
Global
5155
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -108,12 +112,15 @@ Global
108112
{F06DD63E-8965-4C43-BEEE-4ABBB5914FF8} = {90B43DD5-C3CE-4BF8-B63E-3A34B962DC96}
109113
{D3664EBB-D77B-42C2-AF90-7B2F3E354C3F} = {5AE4E956-15A8-4117-9A9D-97B53060FE4C}
110114
{F27309CD-D796-425B-B5D6-780B7B57E9C7} = {B1D2A20A-0742-4D8E-A773-66EB95560152}
111-
{9E3B34BA-E309-4DA4-93D4-C0DD72D4711D} = {F92E5E32-4611-44A1-9EF6-0091F337877B}
112-
{A25A5E30-8D5A-40DB-BA21-7A5B4FB44DE0} = {F92E5E32-4611-44A1-9EF6-0091F337877B}
113115
{510D65E8-B62C-402C-9CE3-47C7055A29FF} = {B1D2A20A-0742-4D8E-A773-66EB95560152}
114116
{B14C5859-85C5-4E2F-80C7-D8B29E36481A} = {B1D2A20A-0742-4D8E-A773-66EB95560152}
115117
{2A0BC610-E0FE-4BC3-B232-A8B918BE7381} = {9557F908-472F-4872-BCF8-8EC028EFDA9B}
116118
{B7E4C23D-48DC-4056-8658-19D54AF7008A} = {90B43DD5-C3CE-4BF8-B63E-3A34B962DC96}
119+
{A25A5E30-8D5A-40DB-BA21-7A5B4FB44DE0} = {18F1AB11-9DC0-442F-9B6D-7098A93727B8}
120+
{9E3B34BA-E309-4DA4-93D4-C0DD72D4711D} = {18F1AB11-9DC0-442F-9B6D-7098A93727B8}
121+
{90B43DD5-C3CE-4BF8-B63E-3A34B962DC96} = {0192C262-63AF-4918-B142-EC07DBB9E501}
122+
{1DF1AB0D-37CB-4AFC-B701-8F0F2B260E54} = {0192C262-63AF-4918-B142-EC07DBB9E501}
123+
{5AE4E956-15A8-4117-9A9D-97B53060FE4C} = {0192C262-63AF-4918-B142-EC07DBB9E501}
117124
EndGlobalSection
118125
GlobalSection(ExtensibilityGlobals) = postSolution
119126
SolutionGuid = {A953E534-FBCA-4F30-9CA5-96F67C1A49D8}
Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
51
using Microsoft.AspNetCore.Hosting;
6-
using Microsoft.Extensions.Configuration;
72
using Microsoft.Extensions.Hosting;
8-
using Microsoft.Extensions.Logging;
93

10-
namespace KafkaFlow.Retry.API.Sample
4+
namespace KafkaFlow.Retry.API.Sample;
5+
6+
public class Program
117
{
12-
public class Program
8+
public static void Main(string[] args)
139
{
14-
public static void Main(string[] args)
15-
{
16-
CreateHostBuilder(args).Build().Run();
17-
}
10+
CreateHostBuilder(args).Build().Run();
11+
}
1812

19-
public static IHostBuilder CreateHostBuilder(string[] args) =>
20-
Host.CreateDefaultBuilder(args)
21-
.ConfigureWebHostDefaults(webBuilder =>
22-
{
23-
webBuilder.UseStartup<Startup>();
24-
});
13+
public static IHostBuilder CreateHostBuilder(string[] args)
14+
{
15+
return Host.CreateDefaultBuilder(args)
16+
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
2517
}
26-
}
18+
}

samples/KafkaFlow.Retry.API.Sample/Startup.cs

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,52 @@
55
using Microsoft.Extensions.DependencyInjection;
66
using Microsoft.Extensions.Hosting;
77

8-
namespace KafkaFlow.Retry.API.Sample
8+
namespace KafkaFlow.Retry.API.Sample;
9+
10+
public class Startup
911
{
10-
public class Startup
12+
public Startup(IConfiguration configuration)
1113
{
12-
public Startup(IConfiguration configuration)
13-
{
14-
Configuration = configuration;
15-
}
14+
Configuration = configuration;
15+
}
1616

17-
public IConfiguration Configuration { get; }
17+
public IConfiguration Configuration { get; }
1818

19-
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
20-
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
19+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
20+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
21+
{
22+
if (env.IsDevelopment())
2123
{
22-
if (env.IsDevelopment())
23-
{
24-
app.UseDeveloperExceptionPage();
25-
}
24+
app.UseDeveloperExceptionPage();
25+
}
2626

27-
app.UseHttpsRedirection();
27+
app.UseHttpsRedirection();
2828

29-
app.UseRouting();
29+
app.UseRouting();
3030

31-
app.UseAuthorization();
31+
app.UseAuthorization();
3232

33-
app.UseKafkaFlowRetryEndpoints();
33+
app.UseKafkaFlowRetryEndpoints();
3434

35-
app.UseEndpoints(endpoints =>
36-
{
37-
endpoints.MapControllers();
38-
});
39-
}
35+
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
36+
}
4037

41-
// This method gets called by the runtime. Use this method to add services to the container.
42-
public void ConfigureServices(IServiceCollection services)
43-
{
44-
services.AddSingleton(sp =>
45-
new MongoDbDataProviderFactory()
46-
.TryCreate(
47-
new MongoDbSettings
48-
{
49-
ConnectionString = "mongodb://localhost:27017/SVC_KAFKA_FLOW_RETRY_DURABLE",
50-
DatabaseName = "SVC_KAFKA_FLOW_RETRY_DURABLE",
51-
RetryQueueCollectionName = "RetryQueues",
52-
RetryQueueItemCollectionName = "RetryQueueItems"
53-
}
54-
).Result
55-
);
56-
57-
services.AddControllers();
58-
}
38+
// This method gets called by the runtime. Use this method to add services to the container.
39+
public void ConfigureServices(IServiceCollection services)
40+
{
41+
services.AddSingleton(sp =>
42+
new MongoDbDataProviderFactory()
43+
.TryCreate(
44+
new MongoDbSettings
45+
{
46+
ConnectionString = "mongodb://localhost:27017/SVC_KAFKA_FLOW_RETRY_DURABLE",
47+
DatabaseName = "SVC_KAFKA_FLOW_RETRY_DURABLE",
48+
RetryQueueCollectionName = "RetryQueues",
49+
RetryQueueItemCollectionName = "RetryQueueItems"
50+
}
51+
).Result
52+
);
53+
54+
services.AddControllers();
5955
}
6056
}

0 commit comments

Comments
 (0)