Skip to content

Commit

Permalink
fix smells
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelwurm committed Jan 11, 2023
1 parent 9fd4d90 commit a303e75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 1 addition & 3 deletions NetEvent/Server/Extensions/DefaultCultureExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NetEvent.Server.Data;
using NetEvent.Server.Models;
using NetEvent.Shared;
using NetEvent.Shared.Config;

namespace NetEvent.Server.Extensions;
Expand All @@ -24,7 +22,7 @@ public static Task SetDefaultCulture(this WebApplication app)
{
using (var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>())
{
var organizationCulture = new SystemSettings.OrganizationData().Settings.Select(x => x.Key.Equals(SystemSettings.OrganizationData.DataCultureInfo)).ToString();;
var organizationCulture = new SystemSettings.OrganizationData().Settings.Select(x => x.Key.Equals(SystemSettings.OrganizationData.DataCultureInfo, StringComparison.OrdinalIgnoreCase)).ToString();
if (organizationCulture == null)
{
return Task.CompletedTask;
Expand Down
10 changes: 4 additions & 6 deletions NetEvent/Server/Modules/System/Endpoints/GetSystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using NetEvent.Shared.Dto;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using NetEvent.Server;
using NetEvent.Shared.Dto;

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

// TODO: remove localizer as soon as it is implemented somewhere where it makes sense
public Handler(IStringLocalizer<Localize> localizer)
{
_Localizer = localizer;
Localizer = localizer;
}

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

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

return Task.FromResult(new Response(systeminfo));
}
Expand Down
4 changes: 2 additions & 2 deletions NetEvent/Server/Modules/System/Endpoints/PostSystemSetting.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Threading;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using NetEvent.Server.Data;
using NetEvent.Server.Models;
using NetEvent.Shared;
using NetEvent.Shared.Config;
using NetEvent.Shared.Dto;
using System.Globalization;

namespace NetEvent.Server.Modules.System.Endpoints
{
Expand Down

0 comments on commit a303e75

Please sign in to comment.