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
@@ -52,7 +52,7 @@ namespace Disco.Web.Areas.API.Controllers
if (redirect)
throw;
else
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
}
}
@@ -114,7 +114,7 @@ namespace Disco.Web.Areas.API.Controllers
var invalidSubjects = subjects.Where(s => s.Item2 == null).ToList();
if (invalidSubjects.Count > 0)
throw new ArgumentException(string.Format("Subjects not found: {0}", string.Join(", ", invalidSubjects)), "Subjects");
throw new ArgumentException($"Subjects not found: {string.Join(", ", invalidSubjects)}", "Subjects");
var proposedSubjects = subjects.Select(s => s.Item2.Id).OrderBy(s => s).ToArray();
var currentSubjects = AuthorizationRole.SubjectIds == null ? new string[0] : AuthorizationRole.SubjectIds.Split(',');
@@ -170,7 +170,7 @@ namespace Disco.Web.Areas.API.Controllers
if (redirect)
throw;
else
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
}
}
@@ -200,7 +200,7 @@ namespace Disco.Web.Areas.API.Controllers
if (redirect)
throw;
else
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
}
}
@@ -229,7 +229,7 @@ namespace Disco.Web.Areas.API.Controllers
if (redirect.HasValue && redirect.Value)
throw;
else
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
}
}
@@ -253,7 +253,7 @@ namespace Disco.Web.Areas.API.Controllers
var invalidSubjects = subjects.Where(s => s.Item2 == null).ToList();
if (invalidSubjects.Count > 0)
throw new ArgumentException(string.Format("Subjects not found: {0}", string.Join(", ", invalidSubjects)), "Subjects");
throw new ArgumentException($"Subjects not found: {string.Join(", ", invalidSubjects)}", "Subjects");
proposedSubjects = subjects.Select(s => s.Item2.Id).OrderBy(s => s).ToArray();
var currentSubjects = UserService.AdministratorSubjectIds;