diff --git a/src/Microsoft.Health.Fhir.Shared.Api/Features/Formatters/FormatParametersValidator.cs b/src/Microsoft.Health.Fhir.Shared.Api/Features/Formatters/FormatParametersValidator.cs index b41f7cd69a..bb4b1cc847 100644 --- a/src/Microsoft.Health.Fhir.Shared.Api/Features/Formatters/FormatParametersValidator.cs +++ b/src/Microsoft.Health.Fhir.Shared.Api/Features/Formatters/FormatParametersValidator.cs @@ -33,7 +33,7 @@ namespace Microsoft.Health.Fhir.Api.Features.Formatters public sealed class FormatParametersValidator : IFormatParametersValidator { private readonly IConformanceProvider _conformanceProvider; - private readonly ICollection _outputFormatters; + private readonly IEnumerable _outputFormatters; private readonly ConcurrentDictionary _supportedFormats = new ConcurrentDictionary(); private readonly ConcurrentDictionary _supportedPatchFormats = new ConcurrentDictionary(); @@ -62,7 +62,7 @@ public async Task CheckRequestedContentTypeAsync(HttpContext httpContext) throw new NotAcceptableException(Api.Resources.UnsupportedFormatParameter); } - string closestClientMediaType = _outputFormatters.GetClosestClientMediaType(resourceFormat.ToContentType(), acceptHeaders?.Select(x => x.MediaType.Value)); + string closestClientMediaType = _outputFormatters.GetClosestClientMediaType(resourceFormat.ToContentType(), acceptHeaders?.Select(x => x.MediaType.Value)?.ToList()); // Overrides output format type httpContext.Response.ContentType = closestClientMediaType; diff --git a/src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleHandler.cs b/src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleHandler.cs index ab0d773a82..e3f273e63d 100644 --- a/src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleHandler.cs +++ b/src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleHandler.cs @@ -845,7 +845,7 @@ private static void SetupContexts( } } - private void PopulateReferenceIdDictionary(IEnumerable bundleEntries, IDictionary idDictionary) + private void PopulateReferenceIdDictionary(IReadOnlyCollection bundleEntries, IDictionary idDictionary) { foreach (EntryComponent entry in bundleEntries) { diff --git a/src/Microsoft.Health.Fhir.Shared.Core/Features/Validation/ServerProvideProfileValidation.cs b/src/Microsoft.Health.Fhir.Shared.Core/Features/Validation/ServerProvideProfileValidation.cs index ea6d937248..e5e887f1f3 100644 --- a/src/Microsoft.Health.Fhir.Shared.Core/Features/Validation/ServerProvideProfileValidation.cs +++ b/src/Microsoft.Health.Fhir.Shared.Core/Features/Validation/ServerProvideProfileValidation.cs @@ -189,7 +189,7 @@ public IEnumerable GetSupportedProfiles(string resourceType, bool disabl .Select(x => x.ResourceUri).ToList(); } - private static string GetHashForSupportedProfiles(IEnumerable summaries) + private static string GetHashForSupportedProfiles(IReadOnlyCollection summaries) { if (summaries == null) { diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportOrchestratorJob.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportOrchestratorJob.cs index 0894609bbb..db10d50996 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportOrchestratorJob.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/ImportOrchestratorJob.cs @@ -257,7 +257,7 @@ internal static IEnumerable GetOffsets(long blobLength, int bytesToRead) } } - private async Task> EnqueueProcessingJobsAsync(IEnumerable inputs, long groupId, ImportOrchestratorJobDefinition coordDefinition, CancellationToken cancellationToken) + private async Task> EnqueueProcessingJobsAsync(IReadOnlyCollection inputs, long groupId, ImportOrchestratorJobDefinition coordDefinition, CancellationToken cancellationToken) { var definitions = new List(); foreach (var input in inputs.OrderBy(_ => RandomNumberGenerator.GetInt32((int)1e9))) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirDataStore.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirDataStore.cs index 72b116da30..d4ab819035 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirDataStore.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirDataStore.cs @@ -426,11 +426,11 @@ internal async Task> ImportResourcesAsync(IReadOnlyList GetErrors(IEnumerable dups, IEnumerable conflicts) + List GetErrors(IReadOnlyCollection dups, IReadOnlyCollection conflicts) { var errors = new List(); foreach (var resource in dups) diff --git a/tools/Exporter/Program.cs b/tools/Exporter/Program.cs index cef9dfa0bd..58f8f02c66 100644 --- a/tools/Exporter/Program.cs +++ b/tools/Exporter/Program.cs @@ -209,7 +209,7 @@ private static int Export(short resourceTypeId, BlobContainerClient container, l return strings.Count; } - private static void WriteBatchOfLines(BlobContainerClient container, IEnumerable batch, string blobName) + private static void WriteBatchOfLines(BlobContainerClient container, IReadOnlyCollection batch, string blobName) { retry: try diff --git a/tools/PerfTester/Program.cs b/tools/PerfTester/Program.cs index 8f9000ccc8..1c010f569c 100644 --- a/tools/PerfTester/Program.cs +++ b/tools/PerfTester/Program.cs @@ -309,7 +309,7 @@ private static void ExecuteParallelCalls(ReadOnlyList<(short ResourceTypeId, str } else if (_callType.StartsWith("SearchByIds")) { - var status = GetResources(_nameFilter, resourceIds.Item2.Select(_ => _.ResourceId)); + var status = GetResources(_nameFilter, resourceIds.Item2.Select(_ => _.ResourceId)?.ToList()); if (status != "OK") { Interlocked.Increment(ref errors); @@ -793,7 +793,7 @@ private static string PostBundle(string jsonString, string resourceType, string return status; } - private static string GetResources(string resourceType, IEnumerable resourceIds) + private static string GetResources(string resourceType, System.Collections.Generic.IReadOnlyCollection resourceIds) { var maxRetries = 3; var retries = 0;