You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
663 B
26 lines
663 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CanYouBuildIt.Model
|
|
{
|
|
public class DictionaryWrapper<TypeComposant, Composant>
|
|
{
|
|
[DataMember]
|
|
public List<KeyValuePair<TypeComposant, Composant>> Items { get; set; }
|
|
|
|
public DictionaryWrapper(Dictionary<TypeComposant, Composant> dictionary)
|
|
{
|
|
Items = dictionary.ToList();
|
|
}
|
|
|
|
public Dictionary<TypeComposant, Composant> ToDico()
|
|
{
|
|
return Items.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
|
}
|
|
}
|
|
}
|