Skip to content

Commit a303e75

Browse files
committed
fix smells
1 parent 9fd4d90 commit a303e75

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

NetEvent/Server/Extensions/DefaultCultureExtension.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.Extensions.DependencyInjection;
77
using Microsoft.Extensions.Logging;
88
using NetEvent.Server.Data;
9-
using NetEvent.Server.Models;
10-
using NetEvent.Shared;
119
using NetEvent.Shared.Config;
1210

1311
namespace NetEvent.Server.Extensions;
@@ -24,7 +22,7 @@ public static Task SetDefaultCulture(this WebApplication app)
2422
{
2523
using (var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>())
2624
{
27-
var organizationCulture = new SystemSettings.OrganizationData().Settings.Select(x => x.Key.Equals(SystemSettings.OrganizationData.DataCultureInfo)).ToString();;
25+
var organizationCulture = new SystemSettings.OrganizationData().Settings.Select(x => x.Key.Equals(SystemSettings.OrganizationData.DataCultureInfo, StringComparison.OrdinalIgnoreCase)).ToString();
2826
if (organizationCulture == null)
2927
{
3028
return Task.CompletedTask;

NetEvent/Server/Modules/System/Endpoints/GetSystemInfo.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
using System.Threading;
55
using System.Threading.Tasks;
66
using MediatR;
7-
using NetEvent.Shared.Dto;
8-
using Microsoft.AspNetCore.Components;
97
using Microsoft.Extensions.Localization;
10-
using NetEvent.Server;
8+
using NetEvent.Shared.Dto;
119

1210
namespace NetEvent.Server.Modules.System.Endpoints
1311
{
@@ -16,12 +14,12 @@ public static class GetSystemInfo
1614
public sealed class Handler : IRequestHandler<Request, Response>
1715
{
1816
// TODO: remove localizer as soon as it is implemented somewhere where it makes sense
19-
private IStringLocalizer<Localize> _Localizer { get; set; }
17+
private IStringLocalizer<Localize> Localizer { get; set; }
2018

2119
// TODO: remove localizer as soon as it is implemented somewhere where it makes sense
2220
public Handler(IStringLocalizer<Localize> localizer)
2321
{
24-
_Localizer = localizer;
22+
Localizer = localizer;
2523
}
2624

2725
public Task<Response> Handle(Request request, CancellationToken cancellationToken)
@@ -50,7 +48,7 @@ public Task<Response> Handle(Request request, CancellationToken cancellationToke
5048
var systeminfo = new SystemInfoDto(systeminfocomponents, systeminfohealth, systeminfoversions);
5149

5250
// TODO: remove localizer as soon as it is implemented somewhere where it makes sense
53-
Console.WriteLine(_Localizer["test.test"]);
51+
Console.WriteLine(Localizer["test.test"]);
5452

5553
return Task.FromResult(new Response(systeminfo));
5654
}

NetEvent/Server/Modules/System/Endpoints/PostSystemSetting.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Threading;
1+
using System.Globalization;
2+
using System.Threading;
23
using System.Threading.Tasks;
34
using MediatR;
45
using NetEvent.Server.Data;
56
using NetEvent.Server.Models;
67
using NetEvent.Shared;
78
using NetEvent.Shared.Config;
89
using NetEvent.Shared.Dto;
9-
using System.Globalization;
1010

1111
namespace NetEvent.Server.Modules.System.Endpoints
1212
{

0 commit comments

Comments
 (0)