Skip to content

Commit ac37207

Browse files
committed
Update .editorconfig and NuGet package versions
Enhanced coding style preferences in .editorconfig by adding new rules for collection expressions, simple property accessors, and System.Threading.Lock usage. Simplified naming conventions by removing unnecessary prefixes, suffixes, and separators. Updated NuGet package versions in TwoFactorAuthenticationSample.DataAccessLayer.csproj and TwoFactorAuthenticationSample.csproj to the latest releases, including Microsoft.AspNetCore and EntityFrameworkCore packages, ensuring improved performance and new features.
1 parent 7b5fe82 commit ac37207

3 files changed

Lines changed: 35 additions & 26 deletions

File tree

.editorconfig

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dotnet_style_operator_placement_when_wrapping = beginning_of_line
2222
dotnet_style_object_initializer = true:suggestion
2323
dotnet_style_coalesce_expression = true:suggestion
2424
dotnet_style_collection_initializer = true:suggestion
25+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
2526
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
2627
dotnet_style_prefer_conditional_expression_over_assignment = false:silent
2728
dotnet_style_prefer_conditional_expression_over_return = false:silent
@@ -81,6 +82,7 @@ csharp_style_prefer_local_over_anonymous_function = true:silent
8182
csharp_style_prefer_extended_property_pattern = true:suggestion
8283
csharp_style_implicit_object_creation_when_type_is_apparent = true:silent
8384
csharp_style_prefer_tuple_swap = true:silent
85+
csharp_style_prefer_simple_property_accessors = true:suggestion
8486

8587
# Field preferences
8688
dotnet_style_readonly_field = true:suggestion
@@ -131,6 +133,7 @@ csharp_prefer_braces = true:silent
131133
csharp_prefer_simple_using_statement = true:suggestion
132134
csharp_style_namespace_declarations = file_scoped:suggestion
133135
csharp_style_prefer_method_group_conversion = true:silent
136+
csharp_prefer_system_threading_lock = true:suggestion
134137

135138
# Expression-level preferences
136139
csharp_prefer_simple_default_expression = true:suggestion
@@ -243,48 +246,48 @@ dotnet_naming_rule.async_method_should_be_ends_with_async.style = ends_with_asyn
243246

244247
dotnet_naming_symbols.interface.applicable_kinds = interface
245248
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
246-
dotnet_naming_symbols.interface.required_modifiers =
249+
dotnet_naming_symbols.interface.required_modifiers =
247250

248251
dotnet_naming_symbols.method.applicable_kinds = method
249252
dotnet_naming_symbols.method.applicable_accessibilities = public
250-
dotnet_naming_symbols.method.required_modifiers =
253+
dotnet_naming_symbols.method.required_modifiers =
251254

252255
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
253256
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
254-
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
257+
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
255258

256259
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
257260
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
258-
dotnet_naming_symbols.types.required_modifiers =
261+
dotnet_naming_symbols.types.required_modifiers =
259262

260263
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
261264
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
262-
dotnet_naming_symbols.non_field_members.required_modifiers =
265+
dotnet_naming_symbols.non_field_members.required_modifiers =
263266

264267
dotnet_naming_symbols.async_method.applicable_kinds = method
265268
dotnet_naming_symbols.async_method.applicable_accessibilities = *
266269
dotnet_naming_symbols.async_method.required_modifiers = async
267270

268271
# Naming styles
269272

270-
dotnet_naming_style.pascal_case.required_prefix =
271-
dotnet_naming_style.pascal_case.required_suffix =
272-
dotnet_naming_style.pascal_case.word_separator =
273+
dotnet_naming_style.pascal_case.required_prefix =
274+
dotnet_naming_style.pascal_case.required_suffix =
275+
dotnet_naming_style.pascal_case.word_separator =
273276
dotnet_naming_style.pascal_case.capitalization = pascal_case
274277

275278
dotnet_naming_style.begins_with_i.required_prefix = I
276-
dotnet_naming_style.begins_with_i.required_suffix =
277-
dotnet_naming_style.begins_with_i.word_separator =
279+
dotnet_naming_style.begins_with_i.required_suffix =
280+
dotnet_naming_style.begins_with_i.word_separator =
278281
dotnet_naming_style.begins_with_i.capitalization = pascal_case
279282

280-
dotnet_naming_style.camel_case.required_prefix =
281-
dotnet_naming_style.camel_case.required_suffix =
282-
dotnet_naming_style.camel_case.word_separator =
283+
dotnet_naming_style.camel_case.required_prefix =
284+
dotnet_naming_style.camel_case.required_suffix =
285+
dotnet_naming_style.camel_case.word_separator =
283286
dotnet_naming_style.camel_case.capitalization = camel_case
284287

285-
dotnet_naming_style.ends_with_async.required_prefix =
288+
dotnet_naming_style.ends_with_async.required_prefix =
286289
dotnet_naming_style.ends_with_async.required_suffix = Async
287-
dotnet_naming_style.ends_with_async.word_separator =
290+
dotnet_naming_style.ends_with_async.word_separator =
288291
dotnet_naming_style.ends_with_async.capitalization = pascal_case
289292

290293
# IDE0058: Expression value is never used
@@ -294,4 +297,10 @@ dotnet_diagnostic.IDE0058.severity = none
294297
dotnet_diagnostic.IDE0010.severity = none
295298

296299
# IDE0072: Add missing cases
297-
dotnet_diagnostic.IDE0072.severity = none
300+
dotnet_diagnostic.IDE0072.severity = none
301+
302+
# IDE0305: Simplify collection initialization
303+
dotnet_diagnostic.IDE0305.severity = none
304+
305+
# CA1873: Avoid potentially expensive logging
306+
dotnet_diagnostic.CA1873.severity = none

TwoFactorAuthenticationSample.DataAccessLayer/TwoFactorAuthenticationSample.DataAccessLayer.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.5" />
11-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.5" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
10+
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.9" />
11+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.9" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.9" />
1313
</ItemGroup>
1414

1515
</Project>

TwoFactorAuthenticationSample/TwoFactorAuthenticationSample.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.5">
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.9">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
1515
<PackageReference Include="Otp.NET" Version="1.4.0" />
1616
<PackageReference Include="QRCoder" Version="1.6.0" />
17-
<PackageReference Include="SimpleAuthenticationTools" Version="3.0.9" />
18-
<PackageReference Include="SimpleAuthenticationTools.Swashbuckle" Version="3.0.14" />
19-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.1" />
20-
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.0.26" />
21-
<PackageReference Include="TinyHelpers.AspNetCore.Swashbuckle" Version="4.0.19" />
17+
<PackageReference Include="SimpleAuthenticationTools" Version="3.0.15" />
18+
<PackageReference Include="SimpleAuthenticationTools.Swashbuckle" Version="3.0.23" />
19+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
20+
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.6" />
21+
<PackageReference Include="TinyHelpers.AspNetCore.Swashbuckle" Version="4.0.26" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

0 commit comments

Comments
 (0)