microsoft/healthcare-shared-components
Publicmirrored from https://github.com/microsoft/healthcare-shared-componentsAvailable
src/Microsoft.Health.Core/Extensions/KeyValuePairExtensions.cs
19lines · modecode
| 1 | // ------------------------------------------------------------------------------------------------- |
| 2 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. |
| 4 | // ------------------------------------------------------------------------------------------------- |
| 5 | |
| 6 | using System; |
| 7 | using System.Collections.Generic; |
| 8 | using System.Linq; |
| 9 | |
| 10 | namespace Microsoft.Health.Core.Extensions |
| 11 | { |
| 12 | public static class KeyValuePairExtensions |
| 13 | { |
| 14 | public static IReadOnlyList<Tuple<T1, T2>> AsTuples<T1, T2>(this IEnumerable<KeyValuePair<T1, T2>> collection) |
| 15 | { |
| 16 | return collection.Select(x => Tuple.Create(x.Key, x.Value)).ToArray(); |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |