Skip to content

Commit

Permalink
User story 100880 - Changes for Routing and Binders namespace. (#3905)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-ajajvanu authored Jun 11, 2024
1 parent 7e0c95e commit b7bd20d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override void Load()

var data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

EnumerateKeys(keys, data);
EnumerateKeys((IReadOnlyCollection<string>)keys, data);

Data = data;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public static bool TryParseDictionaryJson(string value, out Dictionary<string, s
}
}

private void EnumerateKeys(IEnumerable<string> keys, Dictionary<string, string> data, string path = null)
private void EnumerateKeys(IReadOnlyCollection<string> keys, Dictionary<string, string> data, string path = null)
{
foreach (string keyName in keys.Distinct())
{
Expand All @@ -103,7 +103,7 @@ private void EnumerateKeys(IEnumerable<string> keys, Dictionary<string, string>
}
}

IEnumerable<string> innerKeys = _configurationProvider.GetChildKeys(Array.Empty<string>(), keyPath);
var innerKeys = (IReadOnlyCollection<string>)_configurationProvider.GetChildKeys(Array.Empty<string>(), keyPath);
EnumerateKeys(innerKeys, data, keyPath);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Health.Fhir.Api/Features/Routing/UrlResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private Uri ResolveResourceUrl(string resourceId, string resourceTypeName, strin
Request.Host.Value);
}

public Uri ResolveRouteUrl(IEnumerable<Tuple<string, string>> unsupportedSearchParams = null, IReadOnlyList<(SearchParameterInfo searchParameterInfo, SortOrder sortOrder)> resultSortOrder = null, string continuationToken = null, bool removeTotalParameter = false)
public Uri ResolveRouteUrl(IReadOnlyCollection<Tuple<string, string>> unsupportedSearchParams = null, IReadOnlyList<(SearchParameterInfo searchParameterInfo, SortOrder sortOrder)> resultSortOrder = null, string continuationToken = null, bool removeTotalParameter = false)
{
string routeName = _fhirRequestContextAccessor.RequestContext.RouteName;

Expand Down Expand Up @@ -193,7 +193,7 @@ public Uri ResolveRouteUrl(IEnumerable<Tuple<string, string>> unsupportedSearchP
else
{
// 3. The exclude unsupported parameters
IEnumerable<string> removedValues = searchParamsToRemove[searchParam.Key];
var removedValues = searchParamsToRemove[searchParam.Key].ToList();
StringValues usedValues = removedValues.Any()
? new StringValues(
searchParam.Value.Select(x => x.SplitByOrSeparator().Except(removedValues).JoinByOrSeparator())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface IUrlResolver
/// <param name="continuationToken">The continuation token.</param>
/// <param name="removeTotalParameter">True if the _total parameter should be removed from the url, false otherwise.</param>
/// <returns>The URL.</returns>
Uri ResolveRouteUrl(IEnumerable<Tuple<string, string>> unsupportedSearchParams = null, IReadOnlyList<(SearchParameterInfo searchParameterInfo, SortOrder sortOrder)> resultSortOrder = null, string continuationToken = null, bool removeTotalParameter = false);
Uri ResolveRouteUrl(IReadOnlyCollection<Tuple<string, string>> unsupportedSearchParams = null, IReadOnlyList<(SearchParameterInfo searchParameterInfo, SortOrder sortOrder)> resultSortOrder = null, string continuationToken = null, bool removeTotalParameter = false);

/// <summary>
/// Resolves the URL for the specified routeName.
Expand Down

0 comments on commit b7bd20d

Please sign in to comment.