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
@@ -58,7 +58,7 @@ namespace Disco.Web.Models.InitialConfig
wReq.KeepAlive = false;
// End Added: 2013-02-08 G#
wReq.Method = WebRequestMethods.Http.Get;
wReq.UserAgent = string.Format("Disco/{0} (Initial Config; Org: {1})", DiscoApplication.Version, DiscoApplication.OrganisationName);
wReq.UserAgent = $"Disco/{DiscoApplication.Version} (Initial Config; Org: {DiscoApplication.OrganisationName})";
using (HttpWebResponse wRes = (HttpWebResponse)wReq.GetResponse())
{
if (wRes.StatusCode == HttpStatusCode.OK)
@@ -67,7 +67,7 @@ namespace Disco.Web.Models.InitialConfig
}
else
{
DiscoIctComAuWebResult = new Exception(string.Format("Server returned response: [{0}] {1}", wRes.StatusCode, wRes.StatusDescription));
DiscoIctComAuWebResult = new Exception($"Server returned response: [{wRes.StatusCode}] {wRes.StatusDescription}");
}
}
}
@@ -67,7 +67,7 @@ namespace Disco.Web.Models.InitialConfig
}
catch (Exception ex)
{
return new ValidationResult(string.Format("Unable to Create Directory '{0}'; [{1}] {2}", info.FullName, ex.GetType().Name, ex.Message));
return new ValidationResult($"Unable to Create Directory '{info.FullName}'; [{ex.GetType().Name}] {ex.Message}");
}
}
}
+2 -2
View File
@@ -132,7 +132,7 @@ namespace Disco.Web.Models.Job
if (SubTypes != null)
{
var subTypes = SubTypes;
return JobTypes.SelectMany(jt => jt.JobSubTypes).Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList();
return JobTypes.SelectMany(jt => jt.JobSubTypes).Where(m => subTypes.Contains($"{m.JobTypeId}_{m.Id}")).ToList();
}
return null;
}
@@ -146,7 +146,7 @@ namespace Disco.Web.Models.Job
if (!string.IsNullOrEmpty(model.Type) && model.SubTypes != null)
{
var typeId = string.Format("{0}_", model.Type);
var typeId = $"{model.Type}_";
model.SubTypes = model.SubTypes.Where(m => m.StartsWith(typeId)).ToList();
if (model.SubTypes.Count == 0)
{
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Disco.Web.Models.Job
{
get
{
return string.Format("{0} ({1})", Title, JobTable.Items.Count());
return $"{Title} ({JobTable.Items.Count()})";
}
}
}