qol: interpolated strings
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Disco.Web.Models.Job
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format("{0} ({1})", Title, JobTable.Items.Count());
|
||||
return $"{Title} ({JobTable.Items.Count()})";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user