mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 22:38:30 +01:00
ReSharper format: conform inline 'out' parameters.
This commit is contained in:
@@ -89,8 +89,7 @@ namespace Emby.Server.Implementations.Services
|
||||
if (restPath.Path.IndexOfAny(InvalidRouteChars) != -1)
|
||||
throw new ArgumentException(string.Format("Route '{0}' on '{1}' contains invalid chars. ", restPath.Path, restPath.RequestType.GetMethodName()));
|
||||
|
||||
List<RestPath> pathsAtFirstMatch;
|
||||
if (!RestPathMap.TryGetValue(restPath.FirstMatchHashKey, out pathsAtFirstMatch))
|
||||
if (!RestPathMap.TryGetValue(restPath.FirstMatchHashKey, out var pathsAtFirstMatch))
|
||||
{
|
||||
pathsAtFirstMatch = new List<RestPath>();
|
||||
RestPathMap[restPath.FirstMatchHashKey] = pathsAtFirstMatch;
|
||||
|
||||
@@ -73,8 +73,7 @@ namespace Emby.Server.Implementations.Services
|
||||
{
|
||||
var actionName = request.Verb ?? "POST";
|
||||
|
||||
ServiceMethod actionContext;
|
||||
if (ServiceExecGeneral.execMap.TryGetValue(ServiceMethod.Key(serviceType, actionName, requestName), out actionContext))
|
||||
if (ServiceExecGeneral.execMap.TryGetValue(ServiceMethod.Key(serviceType, actionName, requestName), out var actionContext))
|
||||
{
|
||||
if (actionContext.RequestFilters != null)
|
||||
{
|
||||
|
||||
@@ -62,8 +62,7 @@ namespace Emby.Server.Implementations.Services
|
||||
{
|
||||
if (this.RestPath == null)
|
||||
{
|
||||
string contentType;
|
||||
this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, out contentType);
|
||||
this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, out var contentType);
|
||||
|
||||
if (contentType != null)
|
||||
ResponseContentType = contentType;
|
||||
@@ -137,9 +136,8 @@ namespace Emby.Server.Implementations.Services
|
||||
|
||||
public static object CreateRequest(IRequest httpReq, RestPath restPath, Dictionary<string, string> requestParams, object requestDto)
|
||||
{
|
||||
string contentType;
|
||||
var pathInfo = !restPath.IsWildCardPath
|
||||
? GetSanitizedPathInfo(httpReq.PathInfo, out contentType)
|
||||
? GetSanitizedPathInfo(httpReq.PathInfo, out var contentType)
|
||||
: httpReq.PathInfo;
|
||||
|
||||
return restPath.CreateRequest(pathInfo, requestParams, requestDto);
|
||||
@@ -239,8 +237,7 @@ namespace Emby.Server.Implementations.Services
|
||||
|
||||
private static RestPath GetRoute(IRequest req)
|
||||
{
|
||||
object route;
|
||||
req.Items.TryGetValue("__route", out route);
|
||||
req.Items.TryGetValue("__route", out var route);
|
||||
return route as RestPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,8 +306,7 @@ namespace Emby.Server.Implementations.Services
|
||||
|
||||
public int MatchScore(string httpMethod, string[] withPathInfoParts)
|
||||
{
|
||||
int wildcardMatchCount;
|
||||
var isMatch = IsMatch(httpMethod, withPathInfoParts, out wildcardMatchCount);
|
||||
var isMatch = IsMatch(httpMethod, withPathInfoParts, out var wildcardMatchCount);
|
||||
if (!isMatch)
|
||||
{
|
||||
return -1;
|
||||
@@ -484,8 +483,7 @@ namespace Emby.Server.Implementations.Services
|
||||
continue;
|
||||
}
|
||||
|
||||
string propertyNameOnRequest;
|
||||
if (!this.propertyNamesMap.TryGetValue(variableName.ToLower(), out propertyNameOnRequest))
|
||||
if (!this.propertyNamesMap.TryGetValue(variableName.ToLower(), out var propertyNameOnRequest))
|
||||
{
|
||||
if (string.Equals("ignore", variableName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user