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
+1 -1
View File
@@ -73,7 +73,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
if (DeviceModel != null)
return string.Format("{0} - {1}", DeviceModel, SerialNumber);
return $"{DeviceModel} - {SerialNumber}";
else
return SerialNumber;
}
@@ -55,7 +55,7 @@ namespace Disco.Models.Repository
{
if (string.IsNullOrWhiteSpace(Name))
{
return string.Format("{0}: {1}", Id, PurchaseDate.ToLongDateString());
return $"{Id}: {PurchaseDate.ToLongDateString()}";
}
return Name;
}
@@ -52,7 +52,7 @@ namespace Disco.Models.Repository
{
return Name;
}
return string.Format("{0} ({1})", Name, ShortName);
return $"{Name} ({ShortName})";
}
[StringLength(200)]
@@ -38,7 +38,7 @@ namespace Disco.Models.Repository
public override string ToString()
{
return string.Format("User Flag Id: {0}; User Id: {1}; Added: {2:s}", UserFlagId, UserId, AddedDate);
return $"User Flag Id: {UserFlagId}; User Id: {UserId}; Added: {AddedDate:s}";
}
}
}
@@ -16,7 +16,7 @@ namespace Disco.Models.Services.Searching
public string Id { get; set; }
public string Type { get { return type; } }
public string Description { get { return string.Format("{0} ({1})", Id, ComputerName); } }
public string Description { get { return $"{Id} ({ComputerName})"; } }
public string[] ScoreValues { get { return LazyScoreValue.Value; } }
public string AssetNumber { get; set; }
@@ -27,7 +27,7 @@ namespace Disco.Models.Services.Searching
if (AssignedUserId != null)
{
if (AssignedUserDisplayName != null)
return string.Format("{0} ({1})", AssignedUserDisplayName, AssignedUserId);
return $"{AssignedUserDisplayName} ({AssignedUserId})";
else
return AssignedUserId;
}
@@ -14,7 +14,7 @@ namespace Disco.Models.Services.Searching
public virtual string Id { get; set; }
public string Type { get { return type; } }
public string Description { get { return string.Format("{0} ({1}; {2})", Id, UserId, DeviceSerialNumber); } }
public string Description { get { return $"{Id} ({UserId}; {DeviceSerialNumber})"; } }
public string[] ScoreValues { get { return LazyScoreValue.Value; } }
public string DeviceSerialNumber { get; set; }
@@ -17,7 +17,7 @@ namespace Disco.Models.Services.Searching
public string Id { get; set; }
public string FriendlyId { get; set; }
public string Type { get { return type; } }
public string Description { get { return string.Format("{0} ({1})", DisplayName, Id); } }
public string Description { get { return $"{DisplayName} ({Id})"; } }
public string[] ScoreValues { get { return LazyScoreValue.Value; } }
public string DisplayName { get; set; }