Most elegant way to copy type alias class to original collection Looking for a most elegant way to copy dictionary type alias to original collection.
using System;
using System.Collections.Generic;
public class SmallDictionary: Dictionary&lt;string, JToken&gt;
public class NestedDictionary : Dictionary&lt;string, SmallDictionaly&gt;

using System.Collections.Generic;
using System.Linq;
using Microsoft.Azure.Adp.Configuration.Events.Entities;
using Newtonsoft.Json.Linq;

public static Dictionary&lt;string, Dictionary&lt;string, JToken&gt;&gt; ToDictionary(this NestedDictionary configurationEntry)
{
   Dictionary&lt;string, Dictionary&lt;string, JToken&gt;&gt; resultDictionary = new Dictionary&lt;string, Dictionary&lt;string, JToken&gt;&gt;();
   foreach (KeyValuePair&lt;string, SmallDictionary&gt; pair in configurationEntry)
   {
      resultDictionary.Add(pair.Key, pair.Value);
   }
   return resultDictionary;
}
```
You definitely don't want to extend a type in order to alias it.
This introduces complexity, is not idiomatic, and most importantly doesn't create an alias.
I believe what you're looking for is the type alias syntax
using System;
using System.Collections.Generic;

using SmallDictionary = Dictionary&lt;string, JToken&gt;;
using NestedDictionary = Dictionary&lt;string, SmallDictionaly&gt;;

As their name implies, type aliases do not create any new types, they simply introducing a scoped alias that refers to the aliased type.
The only real drawback to type aliases is that they cannot be generic.
Moving on the the logic itself,
There's no need to write a loop over the dictionary entries to copy them into it new dictionary.
Dictionary&lt;TKey, TValue&gt; provides a constructor which takes an IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt; allowing us to specify its initial contents.
return new Dictionary&lt;string, Dictionary&lt;string, JToken&gt;&gt;(configurationEntry);

or
return new NestedDictionary(configurationEntry);

Thanks to the type alias