// Copyright Epic Games, Inc. All Rights Reserved.
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace HordeServer.Utilities
{
///
/// Extension methods for collections
///
public static class CollectionExtensions
{
///
/// Adds an arbitrary sequence of items to a protobuf map field
///
/// The key type
/// The value type
/// The map to update
/// Sequence of items to add
public static void Add(this Google.Protobuf.Collections.MapField Map, IEnumerable> Sequence)
{
foreach(KeyValuePair Pair in Sequence)
{
Map.Add(Pair.Key, Pair.Value);
}
}
}
}