code refactoring changes done.

This commit is contained in:
Shreyas Zare
2024-09-14 19:34:12 +05:30
parent d89598e04a
commit b08211d92d
2 changed files with 6 additions and 7 deletions

View File

@@ -141,7 +141,7 @@ namespace DnsServerCore
Dictionary<string, List<KeyValuePair<string, long>>> data; Dictionary<string, List<KeyValuePair<string, long>>> data;
string labelFormat; string labelFormat;
switch (strType.ToLower()) switch (strType.ToLowerInvariant())
{ {
case "lasthour": case "lasthour":
data = _dnsWebService.DnsServer.StatsManager.GetLastHourMinuteWiseStats(utcFormat); data = _dnsWebService.DnsServer.StatsManager.GetLastHourMinuteWiseStats(utcFormat);
@@ -569,7 +569,7 @@ namespace DnsServerCore
List<KeyValuePair<string, long>> topStatsData; List<KeyValuePair<string, long>> topStatsData;
switch (strType.ToLower()) switch (strType.ToLowerInvariant())
{ {
case "lasthour": case "lasthour":
topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastHourTopStats(statsType, limit); topStatsData = _dnsWebService.DnsServer.StatsManager.GetLastHourTopStats(statsType, limit);

View File

@@ -1,6 +1,6 @@
/* /*
Technitium DNS Server Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com) Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
using DnsServerCore.Auth; using DnsServerCore.Auth;
using DnsServerCore.Dns.Zones; using DnsServerCore.Dns.Zones;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net; using System.Net;
@@ -81,7 +80,7 @@ namespace DnsServerCore
string direction = request.QueryOrForm("direction"); string direction = request.QueryOrForm("direction");
if (direction is not null) if (direction is not null)
direction = direction.ToLower(); direction = direction.ToLowerInvariant();
List<string> subZones = new List<string>(); List<string> subZones = new List<string>();
List<DnsResourceRecord> records = new List<DnsResourceRecord>(); List<DnsResourceRecord> records = new List<DnsResourceRecord>();
@@ -187,7 +186,7 @@ namespace DnsServerCore
string direction = request.QueryOrForm("direction"); string direction = request.QueryOrForm("direction");
if (direction is not null) if (direction is not null)
direction = direction.ToLower(); direction = direction.ToLowerInvariant();
List<string> subZones = new List<string>(); List<string> subZones = new List<string>();
List<DnsResourceRecord> records = new List<DnsResourceRecord>(); List<DnsResourceRecord> records = new List<DnsResourceRecord>();
@@ -376,7 +375,7 @@ namespace DnsServerCore
string direction = request.QueryOrForm("direction"); string direction = request.QueryOrForm("direction");
if (direction is not null) if (direction is not null)
direction = direction.ToLower(); direction = direction.ToLowerInvariant();
List<string> subZones = new List<string>(); List<string> subZones = new List<string>();
List<DnsResourceRecord> records = new List<DnsResourceRecord>(); List<DnsResourceRecord> records = new List<DnsResourceRecord>();