qol: interpolated strings

This commit is contained in:
Gary Sharp
2025-07-20 11:56:34 +10:00
parent 4e518d6684
commit 7faebe56a8
108 changed files with 342 additions and 350 deletions
@@ -15,7 +15,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
public override string ToString()
{
if (string.IsNullOrEmpty(Name))
return string.Format("{0} {1}", Manufacturer, Model);
return $"{Manufacturer} {Model}";
else
return Name;
}
@@ -67,7 +67,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
if (model.Types != null && model.SubTypes != null)
{
var typeId = string.Format("{0}_", model.Types);
var typeId = $"{model.Types}_";
model.SubTypes = model.SubTypes.Where(m => model.Types.Contains(m.Substring(0, m.IndexOf("_")))).ToList();
}
}
@@ -70,7 +70,7 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
var current = LongRunningJobDaysThreshold;
if (!options.Any(o => o.Key == current))
{
options.Add(new KeyValuePair<int, string>(current, string.Format("{0} Days", current)));
options.Add(new KeyValuePair<int, string>(current, $"{current} Days"));
options = options.OrderBy(o => o.Key).ToList();
}
@@ -106,7 +106,7 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
var current = StaleJobMinutesThreshold;
if (!options.Any(o => o.Key == current))
{
options.Add(new KeyValuePair<int, string>(current, string.Format("{0} Minutes", current)));
options.Add(new KeyValuePair<int, string>(current, $"{current} Minutes"));
options = options.OrderBy(o => o.Key).ToList();
}