Use string interpolation wherever possible

Majority of cases still need to go through string.Format() due to localization requirements
This commit is contained in:
Archi
2021-09-27 19:59:00 +02:00
parent de19010820
commit f2d3a2a894
29 changed files with 160 additions and 160 deletions

View File

@@ -271,7 +271,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
}
if ((request.Type == ASF.EUserInputType.None) || !Enum.IsDefined(typeof(ASF.EUserInputType), request.Type) || string.IsNullOrEmpty(request.Value)) {
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(request.Type) + " || " + nameof(request.Value))));
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, $"{nameof(request.Type)} || {nameof(request.Value)}")));
}
HashSet<Bot>? bots = Bot.GetBots(botNames);

View File

@@ -60,7 +60,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
}
if (!HttpContext.WebSockets.IsWebSocketRequest) {
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError!, nameof(HttpContext.WebSockets.IsWebSocketRequest) + ": " + HttpContext.WebSockets.IsWebSocketRequest)));
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError!, $"{nameof(HttpContext.WebSockets.IsWebSocketRequest)}: {HttpContext.WebSockets.IsWebSocketRequest}")));
}
// From now on we can return only EmptyResult as the response stream is already being used by existing websocket connection